/* * Project: MoleCuilder * Description: creates and alters molecular systems * Copyright (C) 2010-2012 University of Bonn. All rights reserved. * Please see the LICENSE file or "Copyright notice" in builder.cpp for details. */ /* * atom_bondedparticleinfo.cpp * * Created on: Oct 19, 2009 * Author: heber */ // include config.h #ifdef HAVE_CONFIG_H #include #endif #include "CodePatterns/MemDebug.hpp" #include "CodePatterns/Assert.hpp" #include "CodePatterns/Log.hpp" #include "WorldTime.hpp" #include "atom_bondedparticleinfo.hpp" BondList BondedParticleInfo::emptyList; /** Constructor of class BondedParticleInfo. */ BondedParticleInfo::BondedParticleInfo() : AdaptiveOrder(0), MaxOrder(false) {} /** Destructor of class BondedParticleInfo. */ BondedParticleInfo::~BondedParticleInfo() {} void BondedParticleInfo::AppendTrajectoryStep() { ListOfBonds.push_back(BondList()); LOG(5,"BondedParticleInfo::AppendTrajectoryStep() called, size is " << ListOfBonds.size()); } const BondList& BondedParticleInfo::getListOfBonds() const { if(WorldTime::getTime() < ListOfBonds.size()) return ListOfBonds[WorldTime::getTime()]; else return emptyList; } //BondList& BondedParticleInfo::getListOfBonds() //{ // // todo: here we actually need a container on whose destruction notifiy is emitted, i.e. // // similar or simply an ObservedContainer. // OBSERVE; // NOTIFY(AtomObservable::BondsAdded); // const unsigned int size = ListOfBonds.size(); // ASSERT(WorldTime::getTime() <= size, // "BondedParticleInfo::getBondsAtStep() - Access out of range: " // +toString(WorldTime::getTime()) // +" not in [0,"+toString(size)+"]."); // if (WorldTime::getTime() == size) { // UpdateSteps(); // } // return ListOfBonds[WorldTime::getTime()]; //} const BondList& BondedParticleInfo::getListOfBondsAtStep(unsigned int _step) const { if(_step < ListOfBonds.size()) return ListOfBonds[_step]; else return emptyList; } //BondList& BondedParticleInfo::getListOfBondsAtStep(unsigned int _step) //{ // const unsigned int size = ListOfBonds.size(); // ASSERT(_step <= size, // "BondedParticleInfo::getBondsAtStep() - Access out of range: " // +toString(_step) // +" not in [0,"+toString(size)+"]."); // if (_step == size) { // UpdateSteps(); // } // return ListOfBonds[_step]; //}