/* * UndoRedoHelpers.hpp * * Created on: Apr 5, 2012 * Author: heber */ #ifndef UNDOREDOHELPERS_HPP_ #define UNDOREDOHELPERS_HPP_ // include config.h #ifdef HAVE_CONFIG_H #include #endif #include #include "Atom/AtomicInfo.hpp" #include "Bond/BondInfo.hpp" namespace MoleCuilder { /** Adds removed atoms back to the world whose state is stored as AtomicInfo. * * @param atoms vector of atomicInfo * @return restoral was successful, at least atom could not be restored. */ bool AddAtomsFromAtomicInfo(std::vector &atoms); /** Removes atoms whose state information is stored as AtomicInfo. * * @param atoms vector of atomicInfo */ void RemoveAtomsFromAtomicInfo(std::vector &atoms); /** Stores the required bond information in for all \a atoms in \a bonds. * * @param atoms atoms whose bonds to store * @param bonds vector with bond information on return */ void StoreBondInformationFromAtoms( const std::vector &atoms, std::vector &bonds); /** Recreates bonds from information stored in \a bonds. * * @param bonds bond state information * @return true - all bonds restored, false - at least one bond could not be restored */ bool AddBondsFromBondInfo(const std::vector< BondInfo > &bonds); /** Sets atoms to state information stored as AtomicInfo. * * @param movedatoms vector of atomicInfo */ void SetAtomsFromAtomicInfo(std::vector &movedatoms); /** Selects all atoms inside the given vector * * @param movedatoms vector of atomicInfo */ void SelectAtomsFromAtomicInfo(std::vector &movedatoms); /** Sets the atoms whose id is stored in given AtomicInfo in \a movedatoms * to position in \a MovedToVector. * * @param movedatoms atoms whose position to change * @param MovedToVector vector with old positions */ void ResetAtomPosition(const std::vector &movedatoms, const std::vector &MovedToVector); /** Remove all molecules identified by their ids given in \a ids. * * @param ids vector of molecular ids to remove */ void RemoveMoleculesWithAtomsByIds(const std::vector &ids); } #endif /* UNDOREDOHELPERS_HPP_ */