Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/atom_bondedparticle.cpp

    r68f03d r112b09  
    55 *      Author: heber
    66 */
     7
     8#include "Helpers/MemDebug.hpp"
    79
    810#include "atom.hpp"
     
    7476      *BondFile << nr << "\t" << (*Runner)->GetOtherAtom(this)->nr << "\n";
    7577};
     78
     79/**
     80 * Adds a bond between this bonded particle and another. Does nothing if this
     81 * bond already exists.
     82 *
     83 * \param bonding partner
     84 */
     85void BondedParticle::addBond(BondedParticle* Partner) {
     86  if (IsBondedTo(Partner)) {
     87    return;
     88  }
     89
     90  bond* newBond = new bond((atom*) this, (atom*) Partner, 1, 0);
     91  RegisterBond(newBond);
     92  Partner->RegisterBond(newBond);
     93}
    7694
    7795/** Puts a given bond into atom::ListOfBonds.
Note: See TracChangeset for help on using the changeset viewer.