Changes in / [326a43b:cbf01e]


Ignore:
Files:
18 added
40 edited

Legend:

Unmodified
Added
Removed
  • doc/Doxyfile

    r326a43b rcbf01e  
    114114EXCLUDE                =
    115115EXCLUDE_SYMLINKS       = NO
    116 EXCLUDE_PATTERNS       =
     116EXCLUDE_PATTERNS       = */unittests/* \
     117                                                 */test/*
    117118EXAMPLE_PATH           =
    118119EXAMPLE_PATTERNS       = *
     
    126127#---------------------------------------------------------------------------
    127128SOURCE_BROWSER         = YES
    128 INLINE_SOURCES         = NO
    129 STRIP_CODE_COMMENTS    = YES
     129INLINE_SOURCES         = YES
     130STRIP_CODE_COMMENTS    = NO
    130131REFERENCED_BY_RELATION = NO
    131132REFERENCES_RELATION    = NO
  • src/Actions/Process.cpp

    r326a43b rcbf01e  
    4141}
    4242
     43void Process::setCurrStep(int _currStep){
     44  OBSERVE;
     45  currStep = _currStep;
     46}
     47
    4348float Process::getDoneRatio() {
    4449  if(getMaxSteps())
     
    5156}
    5257
     58void Process::setMaxSteps(int _maxSteps){
     59  maxSteps = _maxSteps;
     60}
    5361
    5462void Process::start(){
     
    6977  starts = false;
    7078}
     79
    7180void Process::step(){
    7281  OBSERVE;
    7382  currStep++;
    7483}
     84
    7585void Process::stop(){
    7686  stops = true;
  • src/Actions/Process.hpp

    r326a43b rcbf01e  
    2929  bool  doesStop();
    3030  int   getCurrStep();
     31  void  setCurrStep(int _currStep);
    3132  float getDoneRatio();
    3233  int   getMaxSteps();
     34  void  setMaxSteps(int _maxSteps);
    3335
    3436protected:
  • src/Descriptors/AtomDescriptor.hpp

    r326a43b rcbf01e  
    1515#include "World.hpp"
    1616
     17class World;
    1718class atom;
    1819
     
    2122
    2223class AtomDescriptor {
     24  // close coupling to the world to allow access
    2325  friend atom* World::getAtom(AtomDescriptor descriptor);
    2426  friend std::vector<atom*> World::getAllAtoms(AtomDescriptor descriptor);
     27  friend class World::AtomIterator;
    2528
    2629  friend AtomDescriptor operator&&(const AtomDescriptor &lhs, const AtomDescriptor &rhs);
  • src/Descriptors/AtomDescriptor_impl.hpp

    r326a43b rcbf01e  
    1 #include "Descriptors/AtomDescriptor.hpp"
     1#ifndef ATOMDESCRIPTOR_IMPL_HPP
     2#define ATOMDESCRIPTOR_IMPL_HPP
    23
    34/************************ Declarations of implementation Objects ************************/
     
    7273  AtomDescriptor::impl_ptr arg;
    7374};
     75
     76#endif //ATOMDESCRIPTOR_IMPL_HPP
  • src/Descriptors/AtomIdDescriptor.cpp

    r326a43b rcbf01e  
    2222
    2323bool AtomIdDescriptor_impl::predicate(std::pair<int,atom*> atom) {
    24   return atom.second->getId()==id;
     24  return atom.first==id;
    2525}
    2626
     
    2929}
    3030
    31 #if 0
    32 
    33 // so far the lookuptable for Atoms-by-id does not work, since atoms don't get an ID upon creation.
    34 // instead of this we rely on walking through all atoms.
    35 
    36 atom *AtomIdDescriptor::find(){
     31atom *AtomIdDescriptor_impl::find(){
    3732  map<int,atom*> atoms = getAtoms();
    3833  map<int,atom*>::iterator res = atoms.find(id);
     
    4035}
    4136
    42 vector<atom*> AtomIdDescriptor::findAll(){
     37vector<atom*> AtomIdDescriptor_impl::findAll(){
    4338  atom *res = find();
    4439  return (res)?(vector<atom*>(1,res)):(vector<atom*>());
    4540}
    46 
    47 #endif
  • src/Descriptors/AtomIdDescriptor_impl.hpp

    r326a43b rcbf01e  
    1 #include "Descriptors/AtomIdDescriptor.hpp"
     1#ifndef ATOMIDDESCRIPTOR_IMPL_HPP
     2#define ATOMIDDESCRIPTOR_IMPL_HPP
     3
    24#include "Descriptors/AtomDescriptor_impl.hpp"
    35
     
    1113
    1214protected:
    13 #if 0
    14   atom *find();
    15   std::vector<atom*> findAll();
    16 #endif
     15  virtual atom *find();
     16  virtual std::vector<atom*> findAll();
    1717private:
    1818  int id;
    1919};
     20
     21#endif //ATOMIDDESCRIPTOR_IMPL_HPP
  • src/Legacy/oldmenu.cpp

    r326a43b rcbf01e  
    99#include "Legacy/oldmenu.hpp"
    1010#include "analysis_correlation.hpp"
     11#include "World.hpp"
    1112#include "atom.hpp"
    1213#include "bond.hpp"
     
    7778      case 'a': // absolute coordinates of atom
    7879        Log() << Verbose(0) << "Enter absolute coordinates." << endl;
    79         first = new atom;
     80        first = World::get()->createAtom();
    8081        first->x.AskPosition(mol->cell_size, false);
    8182        first->type = periode->AskElement();  // give type
     
    8485
    8586      case 'b': // relative coordinates of atom wrt to reference point
    86         first = new atom;
     87        first = World::get()->createAtom();
    8788        valid = true;
    8889        do {
     
    100101
    101102      case 'c': // relative coordinates of atom wrt to already placed atom
    102         first = new atom;
     103        first = World::get()->createAtom();
    103104        valid = true;
    104105        do {
     
    116117
    117118    case 'd': // two atoms, two angles and a distance
    118         first = new atom;
     119        first = World::get()->createAtom();
    119120        valid = true;
    120121        do {
     
    216217
    217218      case 'e': // least square distance position to a set of atoms
    218         first = new atom;
     219        first = World::get()->createAtom();
    219220        atoms = new (Vector*[128]);
    220221        valid = true;
     
    238239          mol->AddAtom(first);  // add to molecule
    239240        } else {
    240           delete first;
     241          World::get()->destroyAtom(first);
    241242          Log() << Verbose(0) << "Please enter at least two vectors!\n";
    242243        }
     
    736737        Log() << Verbose(0) << "New element by atomic number Z: ";
    737738        cin >> Z;
    738         first->type = periode->FindElement(Z);
     739        first->setType(Z);
    739740        Log() << Verbose(0) << "Atom " << first->nr << "'s element is " << first->type->name << "." << endl;
    740741      }
     
    781782        x.AddVector(&y); // per factor one cell width further
    782783        for (int k=count;k--;) { // go through every atom of the original cell
    783           first = new atom(); // create a new body
     784          first = World::get()->createAtom(); // create a new body
    784785          first->x.CopyVector(vectors[k]);  // use coordinate of original atom
    785786          first->x.AddVector(&x);     // translate the coordinates
  • src/Makefile.am

    r326a43b rcbf01e  
    88ANALYSISHEADER = analysis_bonds.hpp analysis_correlation.hpp
    99
    10 ACTIONSSOURCE = Actions/Action.cpp Actions/Process.cpp Actions/MethodAction.cpp Actions/ActionSequence.cpp Actions/MakroAction.cpp Actions/ErrorAction.cpp Actions/small_actions.cpp Actions/ActionRegistry.cpp
    11 ACTIONSHEADER = Actions/Action.hpp Actions/Process.hpp Actions/MethodAction.hpp Actions/ActionSequence.hpp Actions/MakroAction.hpp Actions/ErrorAction.hpp Actions/small_actions.hpp Actions/ActionRegistry.hpp
     10# only include Actions that are free of user interaction at this point
     11# the UIFactory et. al. wont be known for the libmolecuilder, so the user interaction cannot be done.
     12ACTIONSSOURCE = Actions/Action.cpp Actions/Process.cpp Actions/MethodAction.cpp Actions/ActionSequence.cpp Actions/MakroAction.cpp Actions/ManipulateAtomsProcess.cpp Actions/ActionRegistry.cpp
     13ACTIONSHEADER = Actions/Action.hpp Actions/Process.hpp Actions/Calculation.hpp Actions/Calculation_impl.hpp Actions/MethodAction.hpp Actions/ActionSequence.hpp Actions/MakroAction.hpp Actions/ManipulateAtomsProcess.hpp Actions/ActionRegistry.hpp
     14
     15# All actions that need user interaction go here
     16MENUACTIONSSOURCE = Actions/ErrorAction.cpp Actions/small_actions.cpp
     17MENUACTIONSHEADER = Actions/ErrorAction.hpp Actions/small_actions.hpp
    1218
    1319PATTERNSOURCE = Patterns/Observer.cpp
     
    2026MENUHEADER = Menu/Menu.hpp Menu/TextMenu.hpp Menu/MenuItem.hpp Menu/SubMenuItem.hpp Menu/ActionMenuItem.hpp Menu/SeperatorItem.hpp Menu/DisplayMenuItem.hpp
    2127
    22 UISOURCE = ${ACTIONSSOURCE} ${VIEWSOURCE} ${MENUSOURCE} UIElements/TextUIFactory.cpp UIElements/MainWindow.cpp UIElements/TextWindow.cpp UIElements/Dialog.cpp UIElements/TextDialog.cpp
    23 UIHEADER = ${ACTIONSHEADER} ${VIEWHEADER} ${MENUHEADER} UIElements/TextUIFactory.hpp UIElements/MainWindow.hpp UIElements/TextWindow.hpp UIElements/Dialog.hpp UIElements/TextDialog.hpp
    24 
     28UISOURCE = ${MENUACTIONSSOURCE} ${VIEWSOURCE} ${MENUSOURCE} UIElements/TextUIFactory.cpp UIElements/MainWindow.cpp UIElements/TextWindow.cpp UIElements/Dialog.cpp UIElements/TextDialog.cpp UIElements/TextStatusIndicator.cpp
     29UIHEADER = ${MENUACTIONSHEADER} ${VIEWHEADER} ${MENUHEADER} UIElements/TextUIFactory.hpp UIElements/MainWindow.hpp UIElements/TextWindow.hpp UIElements/Dialog.hpp UIElements/TextDialog.hpp UIElements/TextStatusIndicator.hpp
    2530
    2631FACTORYSOURCE = UIElements/UIFactory.cpp
     
    3641QTUIMOC_TARGETS = QTMainWindow.moc.cpp QTMenu.moc.cpp QTDialog.moc.cpp QTMoleculesView.moc.cpp GLMoleculeView.moc.cpp QTStatusBar.moc.cpp
    3742
    38 DESCRIPTORSOURCE = Descriptors/AtomDescriptor.cpp Descriptors/AtomIdDescriptor.cpp
    39 DESCRIPTORHEADER = Descriptors/AtomDescriptor.hpp Descriptors/AtomIdDescriptor.hpp
     43DESCRIPTORSOURCE = Descriptors/AtomDescriptor.cpp Descriptors/AtomIdDescriptor.cpp Descriptors/AtomTypeDescriptor.cpp
     44DESCRIPTORHEADER = Descriptors/AtomDescriptor.hpp Descriptors/AtomIdDescriptor.hpp Descriptors/AtomTypeDescriptor.hpp
    4045
    4146QTUISOURCE = ${QTUIMOC_TARGETS} UIElements/QT4/QTMainWindow.cpp UIElements/QT4/QTDialog.cpp UIElements/QT4/QTUIFactory.cpp Menu/QT4/QTMenu.cpp Views/QT4/QTMoleculesView.cpp Views/QT4/GLMoleculeView.cpp Views/QT4/QTStatusBar.cpp
     
    4449QTUI_DEFS =
    4550
    46 SOURCE = ${ANALYSISSOURCE} ${ATOMSOURCE} ${PATTERNSOURCE} ${DESCRIPTORSOURCE} bond.cpp bondgraph.cpp boundary.cpp config.cpp element.cpp ellipsoid.cpp errorlogger.cpp graph.cpp helpers.cpp info.cpp leastsquaremin.cpp linkedcell.cpp log.cpp logger.cpp memoryusageobserver.cpp moleculelist.cpp molecule.cpp molecule_dynamics.cpp molecule_fragmentation.cpp molecule_geometry.cpp molecule_graph.cpp molecule_pointcloud.cpp parser.cpp periodentafel.cpp tesselation.cpp tesselationhelpers.cpp vector.cpp verbose.cpp World.cpp
    47 HEADER = ${ANALYSISHEADER} ${ATOMHEADER} ${PATTERNHEADER} ${DESCRIPTORHEADER} ${LEGACYHEADER} bond.hpp bondgraph.hpp boundary.hpp config.hpp defs.hpp element.hpp ellipsoid.hpp errorlogger.hpp graph.hpp helpers.hpp info.hpp leastsquaremin.hpp linkedcell.hpp lists.hpp log.hpp logger.hpp memoryallocator.hpp memoryusageobserver.hpp molecule.hpp molecule_template.hpp parser.hpp periodentafel.hpp stackclass.hpp tesselation.hpp tesselationhelpers.hpp vector.hpp verbose.hpp World.hpp
    48 
     51SOURCE = ${ANALYSISSOURCE} ${ATOMSOURCE} ${PATTERNSOURCE} ${ACTIONSSOURCE} ${DESCRIPTORSOURCE}  bond.cpp bondgraph.cpp boundary.cpp config.cpp element.cpp ellipsoid.cpp errorlogger.cpp graph.cpp helpers.cpp info.cpp leastsquaremin.cpp linkedcell.cpp lists.cpp log.cpp logger.cpp memoryusageobserver.cpp moleculelist.cpp molecule.cpp molecule_dynamics.cpp molecule_fragmentation.cpp molecule_geometry.cpp molecule_graph.cpp molecule_pointcloud.cpp parser.cpp periodentafel.cpp tesselation.cpp tesselationhelpers.cpp vector.cpp verbose.cpp World.cpp WorldIterators.cpp
     52HEADER = ${ANALYSISHEADER} ${ATOMHEADER} ${PATTERNHEADER} ${ACTIONSHEADER} ${DESCRIPTORHEADER} ${LEGACYHEADER} bond.hpp bondgraph.hpp boundary.hpp config.hpp defs.hpp element.hpp ellipsoid.hpp errorlogger.hpp graph.hpp helpers.hpp info.hpp leastsquaremin.hpp linkedcell.hpp lists.hpp log.hpp logger.hpp memoryallocator.hpp memoryusageobserver.hpp molecule.hpp molecule_template.hpp parser.hpp periodentafel.hpp stackclass.hpp tesselation.hpp tesselationhelpers.hpp vector.hpp verbose.hpp World.hpp
    4953
    5054BOOST_LIB = $(BOOST_LDFLAGS) $(BOOST_MPL_LIB)
  • src/UIElements/Dialog.cpp

    r326a43b rcbf01e  
    142142  *target = *tmp;
    143143}
     144
     145// Element Queries
     146Dialog::ElementQuery::ElementQuery(std::string title, element **_target) :
     147  Query(title),
     148  target(_target),
     149  tmp(0)
     150  {}
     151
     152Dialog::ElementQuery::~ElementQuery(){}
     153
     154void Dialog::ElementQuery::setResult(){
     155  *target=tmp;
     156}
  • src/UIElements/Dialog.hpp

    r326a43b rcbf01e  
    1515class molecule;
    1616class Vector;
     17class element;
    1718
    1819class Dialog
     
    2728  virtual void queryMolecule(const char*,molecule**,MoleculeListClass*)=0;
    2829  virtual void queryVector(const char*,Vector *,const double *const,bool)=0;
     30  virtual void queryElement(const char*,element **)=0;
    2931
    3032  virtual bool display();
     
    4850  public:
    4951    Query(std::string _title);
    50     ~Query();
     52    virtual ~Query();
    5153    virtual bool handle()=0;
    5254    virtual void setResult()=0;
     
    6163  public:
    6264    IntQuery(std::string title,int *_target);
    63     ~IntQuery();
     65    virtual ~IntQuery();
    6466    virtual bool handle()=0;
    6567    virtual void setResult();
     
    7375  public:
    7476    DoubleQuery(std::string title,double *_target);
    75     ~DoubleQuery();
     77    virtual ~DoubleQuery();
    7678    virtual bool handle()=0;
    7779    virtual void setResult();
     
    8587  public:
    8688    StringQuery(std::string title,std::string *_target);
    87     ~StringQuery();
     89    virtual ~StringQuery();
    8890    virtual bool handle()=0;
    8991    virtual void setResult();
     
    98100  public:
    99101    MoleculeQuery(std::string title, molecule **_target, MoleculeListClass *_molecules);
    100     ~MoleculeQuery();
     102    virtual ~MoleculeQuery();
    101103    virtual bool handle()=0;
    102104    virtual void setResult();
     
    111113  public:
    112114      VectorQuery(std::string title,Vector *_target,const double *const _cellSize,bool _check);
    113       ~VectorQuery();
     115      virtual ~VectorQuery();
    114116      virtual bool handle()=0;
    115117      virtual void setResult();
     
    122124  };
    123125
     126  class ElementQuery : public Query {
     127  public:
     128    ElementQuery(std::string title, element**_target);
     129    virtual ~ElementQuery();
     130    virtual bool handle()=0;
     131    virtual void setResult();
     132  protected:
     133    element *tmp;
     134  private:
     135    element **target;
     136  };
     137
    124138void registerQuery(Query* query);
    125139
  • src/UIElements/QT4/QTDialog.cpp

    r326a43b rcbf01e  
    2121#include <Qt/qcombobox.h>
    2222
     23#include "World.hpp"
     24#include "periodentafel.hpp"
    2325#include "atom.hpp"
     26#include "element.hpp"
    2427#include "molecule.hpp"
    2528
     
    9598}
    9699
     100void QTDialog::queryElement(const char* title, element **target){
     101  registerQuery(new ElementQTQuery(title,target,inputLayout,this));
     102}
     103
    97104/************************** Query Objects *******************************/
    98105
     
    192199  for(iter  = molecules->ListOfMolecules.begin();
    193200      iter != molecules->ListOfMolecules.end();
    194       iter++) {
     201      ++iter) {
    195202    stringstream sstr;
    196203    sstr << (*iter)->IndexNr << "\t" << (*iter)->getName();
     
    255262
    256263
     264QTDialog::ElementQTQuery::ElementQTQuery(std::string _title, element **_target, QBoxLayout *_parent, QTDialog *_dialog) :
     265    Dialog::ElementQuery(_title,_target),
     266    parent(_parent)
     267{
     268  periodentafel *periode = World::get()->getPeriode();
     269  thisLayout = new QHBoxLayout();
     270  titleLabel = new QLabel(QString(getTitle().c_str()));
     271  inputBox = new QComboBox();
     272  element* Elemental = 0;
     273  for(Elemental = periode->start->next;
     274      Elemental!=periode->end;
     275      Elemental = Elemental->next)
     276  {
     277    stringstream sstr;
     278    sstr << Elemental->Z << "\t" << Elemental->name;
     279    inputBox->addItem(QString(sstr.str().c_str()),QVariant(Elemental->Z));
     280  }
     281  parent->addLayout(thisLayout);
     282  thisLayout->addWidget(titleLabel);
     283  thisLayout->addWidget(inputBox);
     284
     285  pipe = new ElementQTQueryPipe(&tmp,_dialog,inputBox);
     286  pipe->update(inputBox->currentIndex());
     287  connect(inputBox,SIGNAL(currentIndexChanged(int)),pipe,SLOT(update(int)));
     288}
     289
     290QTDialog::ElementQTQuery::~ElementQTQuery()
     291{
     292  delete pipe;
     293}
     294
     295bool QTDialog::ElementQTQuery::handle(){
     296  return true;
     297}
     298
    257299/*************************** Plumbing *******************************/
    258300
     
    313355}
    314356
     357ElementQTQueryPipe::ElementQTQueryPipe(element **_content, QTDialog *_dialog, QComboBox *_theBox) :
     358  content(_content),
     359  dialog(_dialog),
     360  theBox(_theBox)
     361{}
     362
     363ElementQTQueryPipe::~ElementQTQueryPipe()
     364{}
     365
     366void ElementQTQueryPipe::update(int newIndex) {
     367  QVariant data = theBox->itemData(newIndex);
     368  int idx = data.toInt();
     369  (*content) = World::get()->getPeriode()->FindElement(idx);
     370  dialog->update();
     371}
     372
  • src/UIElements/QT4/QTDialog.hpp

    r326a43b rcbf01e  
    2626class DoubleQTQueryPipe;
    2727class MoleculeQTQueryPipe;
     28class ElementQTQueryPipe;
    2829
    2930class QTDialog : public QDialog, public Dialog
     
    3940  virtual void queryMolecule(const char*,molecule**,MoleculeListClass*);
    4041  virtual void queryVector(const char*,Vector *,const double *const,bool);
     42  virtual void queryElement(const char*,element **);
    4143
    4244  virtual bool display();
     
    4850    public:
    4951      IntQTQuery(std::string _title, int *_target,QBoxLayout *_parent,QTDialog *_dialog);
    50       ~IntQTQuery();
     52      virtual ~IntQTQuery();
    5153      virtual bool handle();
    5254    private:
     
    6264    public:
    6365      DoubleQTQuery(std::string title, double *_target,QBoxLayout *_parent,QTDialog *_dialog);
    64       ~DoubleQTQuery();
     66      virtual ~DoubleQTQuery();
    6567      virtual bool handle();
    6668    private:
     
    7678    public:
    7779      StringQTQuery(std::string _title, std::string *_target, QBoxLayout *_parent,QTDialog *_dialog);
    78       ~StringQTQuery();
     80      virtual ~StringQTQuery();
    7981      virtual bool handle();
    8082    private:
     
    9092    public:
    9193      MoleculeQTQuery(std::string _title, molecule **_target, MoleculeListClass *_molecules, QBoxLayout *_parent,QTDialog *_dialog);
    92       ~MoleculeQTQuery();
     94      virtual ~MoleculeQTQuery();
    9395      virtual bool handle();
    9496    private:
     
    104106    public:
    105107      VectorQTQuery(std::string title,Vector *_target,const double *const _cellSize,bool _check,QBoxLayout *,QTDialog *);
    106       ~VectorQTQuery();
     108      virtual ~VectorQTQuery();
    107109      virtual bool handle();
    108110    private:
     
    118120    };
    119121
     122    class ElementQTQuery : public Dialog::ElementQuery {
     123    public:
     124      ElementQTQuery(std::string _title, element **_target, QBoxLayout *_parent, QTDialog *_dialog);
     125      virtual ~ElementQTQuery();
     126      virtual bool handle();
     127    private:
     128      QBoxLayout *parent;
     129      QBoxLayout *thisLayout;
     130      QLabel *titleLabel;
     131      QComboBox *inputBox;
     132
     133      ElementQTQueryPipe *pipe;
     134    };
     135
    120136private:
    121137  QBoxLayout *mainLayout;
     
    133149public:
    134150  StringQTQueryPipe(std::string *_content, QTDialog *_dialog);
    135   ~StringQTQueryPipe();
     151  virtual ~StringQTQueryPipe();
    136152
    137153public slots:
     
    148164public:
    149165  IntQTQueryPipe(int *_content, QTDialog *_dialog);
    150   ~IntQTQueryPipe();
     166  virtual ~IntQTQueryPipe();
    151167
    152168public slots:
     
    163179public:
    164180  DoubleQTQueryPipe(double *_content, QTDialog *_dialog);
    165   ~DoubleQTQueryPipe();
     181  virtual ~DoubleQTQueryPipe();
    166182
    167183public slots:
     
    178194public:
    179195  MoleculeQTQueryPipe(molecule **_content, QTDialog *_dialog, QComboBox *_theBox, MoleculeListClass *_molecules);
    180   ~MoleculeQTQueryPipe();
     196  virtual ~MoleculeQTQueryPipe();
    181197
    182198public slots:
     
    190206
    191207};
     208
     209class ElementQTQueryPipe : public QWidget {
     210  Q_OBJECT
     211public:
     212  ElementQTQueryPipe(element **_content, QTDialog *_dialog, QComboBox *_theBox);
     213  virtual ~ElementQTQueryPipe();
     214
     215public slots:
     216  void update(int);
     217
     218private:
     219  element **content;
     220  QTDialog *dialog;
     221  QComboBox *theBox;
     222};
    192223#endif /* QTDIALOG_HPP_ */
  • src/UIElements/TextDialog.cpp

    r326a43b rcbf01e  
    1010#include "UIElements/TextDialog.hpp"
    1111
     12#include "World.hpp"
     13#include "periodentafel.hpp"
    1214#include "atom.hpp"
    1315#include "molecule.hpp"
     
    4547void TextDialog::queryVector(const char* title, Vector *target,const double *const cellSize, bool check) {
    4648  registerQuery(new VectorTextQuery(title,target,cellSize,check));
     49}
     50
     51void TextDialog::queryElement(const char* title, element **target){
     52  registerQuery(new ElementTextQuery(title,target));
    4753}
    4854
     
    113119
    114120bool TextDialog::VectorTextQuery::handle() {
     121 Log() << Verbose(0) << getTitle();
    115122 tmp->AskPosition(cellSize,check);
    116123 return true;
    117124}
     125
     126
     127TextDialog::ElementTextQuery::ElementTextQuery(std::string title, element **target) :
     128    Dialog::ElementQuery(title,target)
     129{}
     130
     131TextDialog::ElementTextQuery::~ElementTextQuery()
     132{}
     133
     134bool TextDialog::ElementTextQuery::handle() {
     135  int Z;
     136  Log() << Verbose(0) << getTitle();
     137  cin >> Z;
     138  tmp = World::get()->getPeriode()->FindElement(Z);
     139  return tmp;
     140}
  • src/UIElements/TextDialog.hpp

    r326a43b rcbf01e  
    2424  virtual void queryMolecule(const char*,molecule**,MoleculeListClass*);
    2525  virtual void queryVector(const char*,Vector *,const double * const,bool);
     26  virtual void queryElement(const char*,element **);
    2627
    2728protected:
     
    3031  public:
    3132    IntTextQuery(std::string title, int *_target);
    32     ~IntTextQuery();
     33    virtual ~IntTextQuery();
    3334    virtual bool handle();
    3435  };
     
    3738  public:
    3839    DoubleTextQuery(std::string title, double *_target);
    39     ~DoubleTextQuery();
     40    virtual ~DoubleTextQuery();
    4041    virtual bool handle();
    4142  };
     
    4445  public:
    4546    StringTextQuery(std::string title, std::string *_target);
    46     ~StringTextQuery();
     47    virtual ~StringTextQuery();
    4748    virtual bool handle();
    4849  };
     
    5152  public:
    5253    MoleculeTextQuery(std::string title, molecule **_target, MoleculeListClass *_molecules);
    53     ~MoleculeTextQuery();
     54    virtual ~MoleculeTextQuery();
    5455    virtual bool handle();
    5556  };
     
    5859  public:
    5960    VectorTextQuery(std::string title,Vector *_target,const double *const _cellSize,bool _check);
    60     ~VectorTextQuery();
     61    virtual ~VectorTextQuery();
     62    virtual bool handle();
     63  };
     64
     65  class ElementTextQuery : public Dialog::ElementQuery {
     66  public:
     67    ElementTextQuery(std::string title, element **_target);
     68    virtual ~ElementTextQuery();
    6169    virtual bool handle();
    6270  };
  • src/UIElements/TextWindow.cpp

    r326a43b rcbf01e  
    3636#include "Menu/DisplayMenuItem.hpp"
    3737#include "Menu/SubMenuItem.hpp"
     38#include "UIElements/TextStatusIndicator.hpp"
    3839#include "Actions/MethodAction.hpp"
    3940#include "Actions/ErrorAction.hpp"
     
    9798
    9899  editMoleculesMenu->addDefault(returnItem);
     100
     101  // Add status indicators etc...
     102
     103  statusIndicator = new TextStatusIndicator();
    99104}
    100105
     
    105110  delete returnFromEditMoleculeAction;
    106111  delete moleculeView;
     112  delete statusIndicator;
    107113  delete main_menu;
    108114}
  • src/UIElements/TextWindow.hpp

    r326a43b rcbf01e  
    1515class oldmenu;
    1616class StringView;
     17class TextStatusIndicator;
    1718
    1819class TextWindow : public MainWindow
     
    3132  // all views that are contained in the main Menu
    3233  StringView *moleculeView;
     34  TextStatusIndicator *statusIndicator;
    3335
    3436  // This class still contains a lot of scattered functionality
  • src/World.cpp

    r326a43b rcbf01e  
    1212#include "periodentafel.hpp"
    1313#include "Descriptors/AtomDescriptor.hpp"
     14#include "Descriptors/AtomDescriptor_impl.hpp"
     15#include "Actions/ManipulateAtomsProcess.hpp"
    1416
    1517using namespace std;
     
    2830}
    2931
     32vector<atom*> World::getAllAtoms(){
     33  return getAllAtoms(AllAtoms());
     34}
     35
    3036int World::numAtoms(){
    3137  return atoms.size();
     
    3642}
    3743
     44/******************** Methods to change World state *********************/
     45
    3846molecule* World::createMolecule(){
    3947  OBSERVE;
     
    4149  mol = new molecule(periode);
    4250  molecules_deprecated->insert(mol);
    43   molecules.insert(mol);
     51  assert(!molecules.count(currMoleculeId));
     52  // store the molecule by ID
     53  molecules[currMoleculeId++] = mol;
    4454  mol->signOn(this);
    4555  return mol;
    4656}
    4757
     58
     59atom *World::createAtom(){
     60  OBSERVE;
     61  atom *res = NewAtom();
     62  assert(!atoms.count(currAtomId));
     63  res->setId(currAtomId++);
     64  res->setWorld(this);
     65  // store the atom by ID
     66  atoms[res->getId()] = res;
     67  return res;
     68}
     69
     70int World::registerAtom(atom *atom){
     71  OBSERVE;
     72  assert(!atoms.count(currAtomId));
     73  atom->setId(currAtomId++);
     74  atom->setWorld(this);
     75  atoms[atom->getId()] = atom;
     76  return atom->getId();
     77}
     78
     79void World::destroyAtom(atom* atom){
     80  OBSERVE;
     81  int id = atom->getId();
     82  destroyAtom(id);
     83}
     84
     85void World::destroyAtom(int id) {
     86  OBSERVE;
     87  atom *atom = atoms[id];
     88  assert(atom);
     89  DeleteAtom(atom);
     90  atoms.erase(id);
     91}
     92
     93ManipulateAtomsProcess* World::manipulateAtoms(boost::function<void(atom*)> op,std::string name,AtomDescriptor descr){
     94  return new ManipulateAtomsProcess(op, descr,name,true);
     95}
     96
     97ManipulateAtomsProcess* World::manipulateAtoms(boost::function<void(atom*)> op,std::string name){
     98  return manipulateAtoms(op,name,AllAtoms());
     99}
     100
     101/********************* Internal Change methods for double Callback and Observer mechanism ********/
     102
     103void World::doManipulate(ManipulateAtomsProcess *proc){
     104  proc->signOn(this);
     105  {
     106    OBSERVE;
     107    proc->doManipulate(this);
     108  }
     109  proc->signOff(this);
     110}
     111
     112/******************************* Iterators ********************************/
     113
     114/*
     115 * Actual Implementation of the iterators can be found in WorldIterators.cpp
     116 */
     117
     118World::AtomIterator World::getAtomIter(AtomDescriptor descr){
     119  return AtomIterator(descr,this);
     120}
     121
     122World::AtomSet::iterator World::atomEnd(){
     123  return atoms.end();
     124}
    48125
    49126/******************************* Singleton Stuff **************************/
     
    53130boost::mutex World::worldLock;
    54131
    55 
    56 
    57132World::World() :
    58     dummyId(0),
     133    currAtomId(0),
     134    currMoleculeId(0),
    59135    periode(new periodentafel),
    60     molecules_deprecated(new MoleculeListClass)
     136    molecules_deprecated(new MoleculeListClass),
     137    atoms(),
     138    molecules()
    61139{
    62140  molecules_deprecated->signOn(this);
     
    65143World::~World()
    66144{
     145  delete molecules_deprecated;
    67146  delete periode;
     147  AtomSet::iterator iter;
     148  for(iter=atoms.begin();iter!=atoms.end();++iter){
     149    DeleteAtom((*iter).second);
     150  }
     151  atoms.clear();
    68152}
    69153
     
    78162
    79163void World::destroy(){
    80   // For legacy reasons all atoms have to be destroyed first, since unregistering would cause deadlocks otherwise
    81   theWorld->destroyLegacy();
    82   //WARNING: at this point we have a small race condition, when sombody now tries to access the world.
    83 
    84164  // boost supports RAII-Style locking, so we don't need to unlock
    85165  boost::mutex::scoped_lock guard(worldLock);
     
    89169
    90170World* World::reset(){
    91   // For legacy reasons all atoms have to be destroyed first, since unregistering would cause deadlocks otherwise
    92   theWorld->destroyLegacy();
    93   //WARNING: at this point we have a small race condition, when sombody now tries to access the world.
    94 
    95171  World* oldWorld = 0;
    96172  {
     
    119195  return molecules_deprecated;
    120196}
    121 
    122 // some legacy stuff to let the World know about items created outside
    123 void World::registerAtom(atom *theAtom){
    124   OBSERVE;
    125   atoms[dummyId++] = theAtom;
    126 }
    127 
    128 void World::destroyLegacy(){
    129   //delete molecules_deprecated;
    130 }
    131 
    132 void World::unregisterAtom(atom *theAtom){
    133   OBSERVE;
    134   atoms.erase(theAtom->getId());
    135 }
  • src/World.hpp

    r326a43b rcbf01e  
    99#define WORLD_HPP_
    1010
    11 #include <boost/thread.hpp>
     11#include <string>
    1212#include <map>
    1313#include <vector>
    1414#include <set>
     15#include <boost/thread.hpp>
     16#include <boost/shared_ptr.hpp>
     17
    1518
    1619#include "Patterns/Observer.hpp"
     
    2427class AtomDescriptor;
    2528class AtomDescriptor_impl;
     29class ManipulateAtomsProcess;
     30template<typename T>
     31class AtomsCalculation;
    2632
    2733class World : public Observable
    2834{
     35// necessary for coupling with descriptors
    2936friend class AtomDescriptor_impl;
     37friend class AtomDescriptor;
     38
     39// Actions, calculations etc associated with the World
     40friend class ManipulateAtomsProcess;
     41template<typename> friend class AtomsCalculation;
     42
     43typedef std::map<int,atom*> AtomSet;
     44typedef std::map<int,molecule*> MoleculeSet;
    3045public:
    3146
    3247  /***** getter and setter *****/
    3348  // reference to pointer is used for legacy reason... reference will be removed latter to keep encapsulation of World object
     49  /**
     50   * returns the periodentafel for the world.
     51   */
    3452  periodentafel *&getPeriode();
     53
     54  /**
     55   * returns the first atom that matches a given descriptor.
     56   * Do not rely on ordering for descriptors that match more than one atom.
     57   */
    3558  atom* getAtom(AtomDescriptor descriptor);
     59
     60  /**
     61   * returns a vector containing all atoms that match a given descriptor
     62   */
    3663  std::vector<atom*> getAllAtoms(AtomDescriptor descriptor);
     64  std::vector<atom*> getAllAtoms();
     65
     66  /**
     67   * returns a calculation that calls a given function on all atoms matching a descriptor.
     68   * the calculation is not called at this point and can be used as an action, i.e. be stored in
     69   * menus, be kept around for later use etc.
     70   */
     71  template<typename T> AtomsCalculation<T>* calcOnAtoms(boost::function<T(atom*)>,std::string,AtomDescriptor);
     72  template<typename T> AtomsCalculation<T>* calcOnAtoms(boost::function<T(atom*)>,std::string);
     73
     74  /**
     75   * get the number of atoms in the World
     76   */
    3777  int numAtoms();
     78
     79  /**
     80   * get the number of molecules in the World
     81   */
    3882  int numMolecules();
    3983
    4084  /***** Methods to work with the World *****/
     85
     86  /**
     87   * create a new molecule. This method should be used whenever any kind of molecule is needed. Assigns a unique
     88   * ID to the molecule and stores it in the World for later retrieval. Do not create molecules directly.
     89   */
    4190  molecule *createMolecule();
     91
     92  /**
     93   * Create a new atom. This method should be used whenever any atom is needed. Assigns a unique ID and stores
     94   * the atom in the World. If the atom is not destroyed it will automatically be destroyed when the world ends.
     95   */
     96  atom *createAtom();
     97
     98  /**
     99   * Registers a Atom unknown to world. Needed in some rare cases, e.g. when cloning atoms, or in some unittests.
     100   * Do not re-register Atoms already known to the world since this will cause double-frees.
     101   */
     102  int registerAtom(atom*);
     103
     104  /**
     105     * Delete some atom and erase it from the world. Use this whenever you need to destroy any atom. Do not call delete on
     106     * atom directly since this will leave the pointer inside the world.
     107   */
     108  void destroyAtom(atom*);
     109
     110  /**
     111   * Delete some atom and erase it from the world. Use this whenever you need to destroy any atom. Do not call delete on
     112   * atom directly since this will leave the pointer inside the world.
     113   */
     114  void destroyAtom(int);
     115
     116  /**
     117   * Produces a process that calls a function on all Atoms matching a given descriptor. The process is not
     118   * called at this time, so it can be passed around, stored inside menuItems etc.
     119   */
     120  ManipulateAtomsProcess* manipulateAtoms(boost::function<void(atom*)>,std::string,AtomDescriptor);
     121  ManipulateAtomsProcess* manipulateAtoms(boost::function<void(atom*)>,std::string);
     122
     123protected:
     124  /**** Iterators to use internal data structures */
     125  class AtomIterator {
     126  public:
     127    AtomIterator();
     128    AtomIterator(AtomDescriptor, World*);
     129    AtomIterator(const AtomIterator&);
     130    AtomIterator& operator=(const AtomIterator&);
     131    AtomIterator& operator++();     // prefix
     132    AtomIterator  operator++(int);  // postfix with dummy parameter
     133    bool operator==(const AtomIterator&);
     134    bool operator==(const AtomSet::iterator&);
     135    bool operator!=(const AtomIterator&);
     136    bool operator!=(const AtomSet::iterator&);
     137    atom* operator*();
     138
     139    int getCount();
     140  protected:
     141    void advanceState();
     142    World* world;
     143    AtomSet::iterator state;
     144    boost::shared_ptr<AtomDescriptor_impl>  descr;
     145    int index;
     146  };
     147
     148  /**
     149   * returns an iterator over all Atoms matching a given descriptor.
     150   * used for internal purposes, like AtomProcesses and AtomCalculations.
     151   */
     152  AtomIterator getAtomIter(AtomDescriptor descr);
     153
     154  /**
     155   * returns an iterator to the end of the AtomSet. Due to overloading this iterator
     156   * can be compared to iterators produced by getAtomIter (see the mis-matching types).
     157   * Thus it can be used to detect when such an iterator is at the end of the list.
     158   * used for internal purposes, like AtomProcesses and AtomCalculations.
     159   */
     160  AtomSet::iterator atomEnd();
     161
     162  /******* Internal manipulation routines for double callback and Observer mechanism ******/
     163  void doManipulate(ManipulateAtomsProcess *);
     164
    42165private:
    43166  periodentafel *periode;
    44   std::map<int,atom*> atoms;
    45   std::set<molecule*> molecules;
     167  AtomSet atoms;
     168  int currAtomId; //!< stores the next available Id for atoms
     169  MoleculeSet molecules;
     170  int currMoleculeId;
    46171
    47172
    48173  /***** singleton Stuff *****/
    49174public:
     175
     176  /**
     177   * get the currently active instance of the World.
     178   */
    50179  static World* get();
     180
     181  /**
     182   * destroy the currently active instance of the World.
     183   */
    51184  static void destroy();
     185
     186  /**
     187   * destroy the currently active instance of the World and immidiately
     188   * create a new one. Use this to reset while somebody is still Observing
     189   * the world and should reset the observed instance. All observers will be
     190   * sent the subjectKille() message from the old world.
     191   */
    52192  static World* reset();
    53193
    54194private:
     195  /**
     196   * private constructor to ensure creation of the world using
     197   * the singleton pattern.
     198   */
    55199  World();
     200
     201  /**
     202   * private destructor to ensure destruction of the world using the
     203   * singleton pattern.
     204   */
    56205  virtual ~World();
    57206
     
    68217  MoleculeListClass *&getMolecules();
    69218
    70   // functions used for the WorldContent template mechanism
    71   void registerAtom(atom *theAtom);
    72   void unregisterAtom(atom *theAtom);
    73219private:
    74   // this function cleans up anything that cannot be cleaned while the lock is active
    75   // at a later point all these cleanups have to be moved to the World Class so the deadlock and
    76   // race condition can both be avoided.
    77   void destroyLegacy();
    78 
    79220  MoleculeListClass *molecules_deprecated;
    80 
    81   // this is needed to assign unique IDs to atoms... so far
    82   // IDs are not assigned upon Atom creation, so we cannot query the ID
    83   // during construction. By using the dummy ID we can make sure all atoms
    84   // are actually stored in the map and don't overwrite each other.
    85   int dummyId;
    86221};
    87222
  • src/atom.cpp

    r326a43b rcbf01e  
    2020/** Constructor of class atom.
    2121 */
    22 atom::atom() : previous(NULL), next(NULL), father(this), sort(&nr)
    23 {
    24   World::get()->registerAtom(this);
     22atom::atom() :
     23  previous(NULL), next(NULL), father(this), sort(&nr)
     24{
    2525  node = &x;  // TesselPoint::x can only be referenced from here
    2626};
     
    2828/** Constructor of class atom.
    2929 */
    30 atom::atom(atom *pointer) : previous(NULL), next(NULL), father(pointer), sort(&nr)
    31 {
    32   World::get()->registerAtom(this);
     30atom::atom(atom *pointer) :
     31    ParticleInfo(pointer),
     32    previous(NULL), next(NULL), father(pointer), sort(&nr)
     33{
    3334  type = pointer->type;  // copy element of atom
    3435  x.CopyVector(&pointer->x); // copy coordination
     
    3839};
    3940
     41atom *atom::clone(){
     42  atom *res = new atom();
     43  res->previous=0;
     44  res->next=0;
     45  res->father = this;
     46  res->sort = &nr;
     47  res->type = type;
     48  res->x.CopyVector(&this->x);
     49  res->v.CopyVector(&this->v);
     50  res->FixedIon = FixedIon;
     51  res->node = &x;
     52  World::get()->registerAtom(res);
     53  return res;
     54}
     55
    4056
    4157/** Destructor of class atom.
     
    4359atom::~atom()
    4460{
    45   World::get()->unregisterAtom(this);
    4661  unlink(this);
    4762};
     
    267282};
    268283
     284World *atom::getWorld(){
     285  return world;
     286}
     287
     288void atom::setWorld(World* _world){
     289  world = _world;
     290}
     291
     292void atom::setId(int _id) {
     293  id=_id;
     294}
     295
     296int atom::getId() {
     297  return id;
     298}
     299
     300atom* NewAtom(){
     301  return new atom();
     302}
     303
     304void  DeleteAtom(atom* atom){
     305  delete atom;
     306}
  • src/atom.hpp

    r326a43b rcbf01e  
    3232
    3333class Vector;
     34class World;
    3435
    3536/********************************************** declarations *******************************/
     
    3940 */
    4041class atom : public TesselPoint, public TrajectoryParticle, public GraphNode, public BondedParticle, public virtual ParticleInfo, public virtual AtomInfo {
     42  friend atom* NewAtom();
     43  friend void  DeleteAtom(atom*);
    4144  public:
    4245    atom *previous; //!< previous atom in molecule list
     
    4548    int *sort;      //!< sort criteria
    4649
    47   atom();
    48   atom(class atom *pointer);
    49   virtual ~atom();
     50  virtual atom *clone();
    5051
    5152  bool OutputIndexed(ofstream * const out, const int ElementNo, const int AtomNo, const char *comment = NULL) const;
     
    6768  bool IsInParallelepiped(const Vector offset, const double *parallelepiped) const;
    6869
     70  // getter and setter
     71
     72  /**
     73   * returns the World that contains this atom.
     74   * Use this if you need to get the world without locking
     75   * the singleton for example.
     76   *
     77   */
     78  World *getWorld();
     79  void setWorld(World*);
     80
     81  virtual int getId();
     82  virtual void setId(int);
     83  protected:
     84    /**
     85     * Protected constructor to ensure construction of atoms through the world.
     86     * see World::createAtom()
     87     */
     88    atom();
     89
     90    /**
     91     * Protected copy-constructor to ensure construction of atoms by cloning.
     92     * see atom::clone()
     93     */
     94    atom(class atom *pointer);
     95
     96    /**
     97     * Protected destructor to ensure destruction of atoms through the world.
     98     * see World::destroyAtom()
     99     */
     100    virtual ~atom();
    69101  private:
     102    World* world;
     103    int id;
    70104};
    71105
     106/**
     107 * internal method used by the world. Do not use if you don't know what you are doing.
     108 * You might get burned...
     109 * Use World::createAtom() instead.
     110 */
     111atom* NewAtom();
     112
     113/**
     114* internal method used by the world. Do not use if you don't know what you are doing.
     115 * You might get burned...
     116 * Use World::destroyAtom() instead.
     117 */
     118void  DeleteAtom(atom*);
     119
     120
    72121#endif /* ATOM_HPP_ */
  • src/atom_atominfo.cpp

    r326a43b rcbf01e  
    66 */
    77
     8#include "periodentafel.hpp"
     9#include "World.hpp"
    810#include "atom_atominfo.hpp"
    911
     
    1820};
    1921
     22element *AtomInfo::getType(){
     23  return type;
     24}
     25
     26void AtomInfo::setType(element* _type) {
     27  type = _type;
     28}
     29
     30void AtomInfo::setType(int Z) {
     31  element *elem = World::get()->getPeriode()->FindElement(Z);
     32  setType(elem);
     33}
  • src/atom_atominfo.hpp

    r326a43b rcbf01e  
    3737  ~AtomInfo();
    3838
     39  element *getType();
     40  void setType(element *);
     41  void setType(int);
     42
    3943private:
    4044};
  • src/atom_particleinfo.cpp

    r326a43b rcbf01e  
    1313ParticleInfo::ParticleInfo() : nr(-1), Name(NULL) {};
    1414
     15ParticleInfo::ParticleInfo(ParticleInfo *pointer) :
     16    Name(pointer->Name),
     17    nr(pointer->nr)
     18    {}
     19
     20
    1521/** Destructor of ParticleInfo.
    1622 */
     
    1925  Free(&Name);
    2026};
    21 
    22 int ParticleInfo::getId() {
    23   return nr;
    24 }
    2527
    2628ostream & operator << (ostream &ost, const ParticleInfo &a)
  • src/atom_particleinfo.hpp

    r326a43b rcbf01e  
    3131
    3232  ParticleInfo();
     33  ParticleInfo(ParticleInfo*);
    3334  ~ParticleInfo();
    3435
    3536  ostream & operator << (ostream &ost) const;
    36 
    37   virtual int getId();
    3837
    3938private:
  • src/boundary.cpp

    r326a43b rcbf01e  
    887887            Walker = Walker->next;
    888888            // copy atom ...
    889             CopyAtoms[Walker->nr] = new atom(Walker);
     889            CopyAtoms[Walker->nr] = Walker->clone();
    890890
    891891            // create atomic random translation vector ...
  • src/builder.cpp

    r326a43b rcbf01e  
    14821482                SaveFlag = true;
    14831483                Log() << Verbose(1) << "Adding new atom with element " << argv[argptr] << " at (" << argv[argptr+1] << "," << argv[argptr+2] << "," << argv[argptr+3] << "), ";
    1484                 first = new atom;
     1484                first = World::get()->createAtom();
    14851485                first->type = periode->FindElement(atoi(argv[argptr]));
    14861486                if (first->type != NULL)
     
    16421642//                first->x.Zero();
    16431643//                filler->AddAtom(first);
    1644                 first = new atom();
     1644                first = World::get()->createAtom();
    16451645                first->type = periode->FindElement(1);
    16461646                first->x.Init(0.441, -0.143, 0.);
    16471647                filler->AddAtom(first);
    1648                 second = new atom();
     1648                second = World::get()->createAtom();
    16491649                second->type = periode->FindElement(1);
    16501650                second->x.Init(-0.464, 1.137, 0.0);
    16511651                filler->AddAtom(second);
    1652                 third = new atom();
     1652                third = World::get()->createAtom();
    16531653                third->type = periode->FindElement(8);
    16541654                third->x.Init(-0.464, 0.177, 0.);
     
    20982098                      x.AddVector(&y); // per factor one cell width further
    20992099                      for (int k=count;k--;) { // go through every atom of the original cell
    2100                         first = new atom(); // create a new body
     2100                        first = World::get()->createAtom(); // create a new body
    21012101                        first->x.CopyVector(vectors[k]);  // use coordinate of original atom
    21022102                        first->x.AddVector(&x);      // translate the coordinates
  • src/config.cpp

    r326a43b rcbf01e  
    88#include <cstring>
    99
     10#include "World.hpp"
    1011#include "atom.hpp"
    1112#include "bond.hpp"
     
    732733            sprintf(keyword,"%s_%i",name, j+1);
    733734            if (repetition == 0) {
    734               neues = new atom();
     735              neues = World::get()->createAtom();
    735736              AtomList[i][j] = neues;
    736737              LinearList[ FileBuffer->LineMapping[FileBuffer->CurrentLine] ] = neues;
     
    811812          sprintf(keyword,"%s_%i",name, j+1);
    812813          if (repetition == 0) {
    813             neues = new atom();
     814            neues = World::get()->createAtom();
    814815            AtomList[i][j] = neues;
    815816            LinearList[ FileBuffer->LineMapping[FileBuffer->CurrentLine] ] = neues;
     
    12871288        }
    12881289        istringstream input2(zeile);
    1289         atom *neues = new atom();
     1290        atom *neues = World::get()->createAtom();
    12901291        input2 >> neues->x.x[0]; // x
    12911292        input2 >> neues->x.x[1]; // y
  • src/lists.hpp

    r326a43b rcbf01e  
    99#define LISTS_HPP_
    1010
     11class atom;
     12
    1113/******************************** Some templates for list management ***********************************/
    1214
     
    1820{
    1921  X *vorher = end->previous;
    20   if (vorher != NULL)
     22  if (vorher != 0)
    2123    vorher->next = walker;
    2224  end->previous = walker;
     
    3133template <typename X> void unlink(X *walker)
    3234{
    33   if (walker->next != NULL)
     35  if (walker->next != 0)
    3436    walker->next->previous = walker->previous;
    35   if (walker->previous != NULL)
     37  if (walker->previous != 0)
    3638    walker->previous->next = walker->next;
    37   walker->next = NULL;
    38   walker->previous= NULL;
     39  walker->next = 0;
     40  walker->previous= 0;
    3941};
    4042
     
    4648template <typename X>  bool add(X *pointer, X *end)
    4749{
    48   if (end != NULL) {
     50  if (end != 0) {
    4951    link(pointer, end);
    5052  } else {
    51     pointer->previous = NULL;
    52     pointer->next = NULL;
     53    pointer->previous = 0;
     54    pointer->next = 0;
    5355  }
    5456  return true;
     
    5961 * \param *start  begin of list
    6062 * \param *end  end of list
    61  * \return X - if found, NULL - if not found
     63 * \return X - if found, 0 - if not found
    6264 */
    6365template <typename X, typename Y> X * find(Y *suche, X *start, X *end)
     
    6870    if (*walker->sort == *suche) return (walker);
    6971  }
    70   return NULL;
     72  return 0;
    7173};
    7274
     
    7779template <typename X> void removewithoutcheck(X *walker)
    7880{
    79   if (walker != NULL) {
     81  if (walker != 0) {
    8082    unlink(walker);
    8183    delete(walker);
    82     walker = NULL;
     84    walker = 0;
    8385  }
    8486};
     87
     88/** Removes an item from the list without check.
     89 *  specialized for atoms, because these have to be removed from the world as well
     90 *  the implementation for this declaration is in lists.cpp
     91 * \param *walker item to be removed
     92 * \return true - removing succeeded, false - given item not found in list
     93 */
     94template <> void removewithoutcheck<atom>(atom *walker);
    8595
    8696/** Removes an item from the list, checks if exists.
     
    99109  }*/
    100110  // atom found, now unlink
    101   if (walker != NULL)
     111  if (walker != 0)
    102112    removewithoutcheck(walker);
    103113  else
     
    114124{
    115125  X *pointer = start->next;
    116   X *walker = NULL;
     126  X *walker = 0;
    117127  while (pointer != end) { // go through list
    118128    walker = pointer; // mark current
     
    131141{
    132142  X *Binder = me;
    133   while(Binder->previous != NULL)
     143  while(Binder->previous != 0)
    134144    Binder = Binder->previous;
    135145  return Binder;
     
    143153{
    144154  X *Binder = me;
    145   while(Binder->next != NULL)
     155  while(Binder->next != 0)
    146156    Binder = Binder->next;
    147157  return Binder;
  • src/molecule.cpp

    r326a43b rcbf01e  
    88#include <boost/bind.hpp>
    99
     10#include "World.hpp"
    1011#include "atom.hpp"
    1112#include "bond.hpp"
     
    3031 * Initialises molecule list with correctly referenced start and end, and sets molecule::last_atom to zero.
    3132 */
    32 molecule::molecule(const periodentafel * const teil) : elemente(teil), start(new atom), end(new atom),
     33molecule::molecule(const periodentafel * const teil) : elemente(teil), start(World::get()->createAtom()), end(World::get()->createAtom()),
    3334  first(new bond(start, end, 1, -1)), last(new bond(start, end, 1, -1)), MDSteps(0), AtomCount(0),
    3435  BondCount(0), ElementCount(0), NoNonHydrogen(0), NoNonBonds(0), NoCyclicBonds(0), BondDistance(0.),
     
    6061  delete(first);
    6162  delete(last);
    62   delete(end);
    63   delete(start);
     63  end->getWorld()->destroyAtom(end);
     64  start->getWorld()->destroyAtom(start);
    6465};
    6566
     
    135136  OBSERVE;
    136137  if (pointer != NULL) {
    137     atom *walker = new atom(pointer);
     138    atom *walker = pointer->clone();
    138139    walker->Name = Malloc<char>(strlen(pointer->Name) + 1, "atom::atom: *Name");
    139140    strcpy (walker->Name, pointer->Name);
     
    242243  switch(TopBond->BondDegree) {
    243244    case 1:
    244       FirstOtherAtom = new atom();    // new atom
     245      FirstOtherAtom = World::get()->createAtom();    // new atom
    245246      FirstOtherAtom->type = elemente->FindElement(1);  // element is Hydrogen
    246247      FirstOtherAtom->v.CopyVector(&TopReplacement->v); // copy velocity
     
    299300
    300301      // create the two Hydrogens ...
    301       FirstOtherAtom = new atom();
    302       SecondOtherAtom = new atom();
     302      FirstOtherAtom = World::get()->createAtom();
     303      SecondOtherAtom = World::get()->createAtom();
    303304      FirstOtherAtom->type = elemente->FindElement(1);
    304305      SecondOtherAtom->type = elemente->FindElement(1);
     
    354355    case 3:
    355356      // take the "usual" tetraoidal angle and add the three Hydrogen in direction of the bond (height of the tetraoid)
    356       FirstOtherAtom = new atom();
    357       SecondOtherAtom = new atom();
    358       ThirdOtherAtom = new atom();
     357      FirstOtherAtom = World::get()->createAtom();
     358      SecondOtherAtom = World::get()->createAtom();
     359      ThirdOtherAtom = World::get()->createAtom();
    359360      FirstOtherAtom->type = elemente->FindElement(1);
    360361      SecondOtherAtom->type = elemente->FindElement(1);
     
    475476    MDSteps++;
    476477  for(i=0;i<NumberOfAtoms;i++){
    477     Walker = new atom;
     478    Walker = World::get()->createAtom();
    478479    getline(xyzfile,line,'\n');
    479480    istringstream *item = new istringstream(line);
  • src/moleculelist.cpp

    r326a43b rcbf01e  
    342342    Log() << Verbose(2) << "INFO: Current Walker is " << *Walker << "." << endl;
    343343    if (!TesselStruct->IsInnerPoint(Walker->x, LCList)) {
    344       CopyAtoms[Walker->nr] = new atom(Walker);
     344      CopyAtoms[Walker->nr] = Walker->clone();
    345345      mol->AddAtom(CopyAtoms[Walker->nr]);
    346346      nr++;
  • src/unittests/AnalysisCorrelationToPointUnitTest.cpp

    r326a43b rcbf01e  
    1717#include "AnalysisCorrelationToPointUnitTest.hpp"
    1818
     19#include "World.hpp"
    1920#include "atom.hpp"
    2021#include "boundary.hpp"
     
    5657  // construct molecule (tetraeder of hydrogens)
    5758  TestMolecule = new molecule(tafel);
    58   Walker = new atom();
     59  Walker = World::get()->createAtom();
    5960  Walker->type = hydrogen;
    6061  Walker->node->Init(1., 0., 1. );
    6162  TestMolecule->AddAtom(Walker);
    62   Walker = new atom();
     63  Walker = World::get()->createAtom();
    6364  Walker->type = hydrogen;
    6465  Walker->node->Init(0., 1., 1. );
    6566  TestMolecule->AddAtom(Walker);
    66   Walker = new atom();
     67  Walker = World::get()->createAtom();
    6768  Walker->type = hydrogen;
    6869  Walker->node->Init(1., 1., 0. );
    6970  TestMolecule->AddAtom(Walker);
    70   Walker = new atom();
     71  Walker = World::get()->createAtom();
    7172  Walker->type = hydrogen;
    7273  Walker->node->Init(0., 0., 0. );
  • src/unittests/AnalysisCorrelationToSurfaceUnitTest.cpp

    r326a43b rcbf01e  
    1717#include "AnalysisCorrelationToSurfaceUnitTest.hpp"
    1818
     19#include "World.hpp"
    1920#include "atom.hpp"
    2021#include "boundary.hpp"
     
    6162  // construct molecule (tetraeder of hydrogens) base
    6263  TestMolecule = new molecule(tafel);
    63   Walker = new atom();
     64  Walker = World::get()->createAtom();
    6465  Walker->type = hydrogen;
    6566  Walker->node->Init(1., 0., 1. );
    6667  TestMolecule->AddAtom(Walker);
    67   Walker = new atom();
     68  Walker = World::get()->createAtom();
    6869  Walker->type = hydrogen;
    6970  Walker->node->Init(0., 1., 1. );
    7071  TestMolecule->AddAtom(Walker);
    71   Walker = new atom();
     72  Walker = World::get()->createAtom();
    7273  Walker->type = hydrogen;
    7374  Walker->node->Init(1., 1., 0. );
    7475  TestMolecule->AddAtom(Walker);
    75   Walker = new atom();
     76  Walker = World::get()->createAtom();
    7677  Walker->type = hydrogen;
    7778  Walker->node->Init(0., 0., 0. );
     
    9495
    9596  // add outer atoms
    96   Walker = new atom();
     97  Walker = World::get()->createAtom();
    9798  Walker->type = carbon;
    9899  Walker->node->Init(4., 0., 4. );
    99100  TestMolecule->AddAtom(Walker);
    100   Walker = new atom();
     101  Walker = World::get()->createAtom();
    101102  Walker->type = carbon;
    102103  Walker->node->Init(0., 4., 4. );
    103104  TestMolecule->AddAtom(Walker);
    104   Walker = new atom();
     105  Walker = World::get()->createAtom();
    105106  Walker->type = carbon;
    106107  Walker->node->Init(4., 4., 0. );
    107108  TestMolecule->AddAtom(Walker);
    108109  // add inner atoms
    109   Walker = new atom();
     110  Walker = World::get()->createAtom();
    110111  Walker->type = carbon;
    111112  Walker->node->Init(0.5, 0.5, 0.5 );
  • src/unittests/AnalysisPairCorrelationUnitTest.cpp

    r326a43b rcbf01e  
    1717#include "AnalysisPairCorrelationUnitTest.hpp"
    1818
     19#include "World.hpp"
    1920#include "atom.hpp"
    2021#include "boundary.hpp"
     
    5556  // construct molecule (tetraeder of hydrogens)
    5657  TestMolecule = new molecule(tafel);
    57   Walker = new atom();
     58  Walker = World::get()->createAtom();
    5859  Walker->type = hydrogen;
    5960  Walker->node->Init(1., 0., 1. );
    6061  TestMolecule->AddAtom(Walker);
    61   Walker = new atom();
     62  Walker = World::get()->createAtom();
    6263  Walker->type = hydrogen;
    6364  Walker->node->Init(0., 1., 1. );
    6465  TestMolecule->AddAtom(Walker);
    65   Walker = new atom();
     66  Walker = World::get()->createAtom();
    6667  Walker->type = hydrogen;
    6768  Walker->node->Init(1., 1., 0. );
    6869  TestMolecule->AddAtom(Walker);
    69   Walker = new atom();
     70  Walker = World::get()->createAtom();
    7071  Walker->type = hydrogen;
    7172  Walker->node->Init(0., 0., 0. );
  • src/unittests/DescriptorUnittest.cpp

    r326a43b rcbf01e  
    2222CPPUNIT_TEST_SUITE_REGISTRATION( DescriptorUnittest );
    2323
    24 // some stubs
    25 class AtomStub : public atom {
    26 public:
    27   AtomStub(int _id) :
    28   atom(),
    29   id(_id)
    30   {}
    31 
    32   virtual int getId(){
    33     return id;
    34   }
    35 
    36 private:
    37   int id;
    38 };
    39 
    40 
    4124// set up and tear down
    4225void DescriptorUnittest::setUp(){
    4326  World::get();
    4427  for(int i=0;i<ATOM_COUNT;++i){
    45     atoms[i]= new AtomStub(i);
     28    atoms[i]= World::get()->createAtom();
     29    atomIds[i] = atoms[i]->getId();
    4630  }
    4731}
    4832void DescriptorUnittest::tearDown(){
    4933  World::destroy();
    50   for(int i=0;i<ATOM_COUNT;++i){
    51     delete atoms[i];
    52   }
    5334}
    5435
    5536// some helper functions
    56 bool hasAll(std::vector<atom*> atoms,int min, int max, std::set<int> excluded = std::set<int>()){
    57   for(int i=min;i<max;++i){
    58     if(!excluded.count(i)){
     37bool hasAll(std::vector<atom*> atoms,int ids[ATOM_COUNT], std::set<int> excluded = std::set<int>()){
     38  for(int i=0;i<ATOM_COUNT;++i){
     39    int id = ids[i];
     40    if(!excluded.count(id)){
    5941      std::vector<atom*>::iterator iter;
    6042      bool res=false;
    6143      for(iter=atoms.begin();iter!=atoms.end();++iter){
    62         res |= (*iter)->getId() == i;
     44        res |= (*iter)->getId() == id;
    6345      }
    6446      if(!res) {
    65         cout << "Atom " << i << " missing in returned list" << endl;
     47        cout << "Atom " << id << " missing in returned list" << endl;
    6648        return false;
    6749      }
     
    8668void DescriptorUnittest::AtomBaseSetsTest(){
    8769  std::vector<atom*> allAtoms = World::get()->getAllAtoms(AllAtoms());
    88   CPPUNIT_ASSERT_EQUAL( true , hasAll(allAtoms,0,ATOM_COUNT));
     70  CPPUNIT_ASSERT_EQUAL( true , hasAll(allAtoms,atomIds));
    8971  CPPUNIT_ASSERT_EQUAL( true , hasNoDuplicates(allAtoms));
    9072
     
    9577  // test Atoms from boundaries and middle of the set
    9678  atom* testAtom;
    97   testAtom = World::get()->getAtom(AtomById(0));
    98   CPPUNIT_ASSERT_EQUAL( 0, testAtom->getId());
    99   testAtom = World::get()->getAtom(AtomById(ATOM_COUNT/2));
    100   CPPUNIT_ASSERT_EQUAL( ATOM_COUNT/2, testAtom->getId());
    101   testAtom = World::get()->getAtom(AtomById(ATOM_COUNT-1));
    102   CPPUNIT_ASSERT_EQUAL( ATOM_COUNT-1, testAtom->getId());
     79  testAtom = World::get()->getAtom(AtomById(atomIds[0]));
     80  CPPUNIT_ASSERT(testAtom);
     81  CPPUNIT_ASSERT_EQUAL( atomIds[0], testAtom->getId());
     82  testAtom = World::get()->getAtom(AtomById(atomIds[ATOM_COUNT/2]));
     83  CPPUNIT_ASSERT(testAtom);
     84  CPPUNIT_ASSERT_EQUAL( atomIds[ATOM_COUNT/2], testAtom->getId());
     85  testAtom = World::get()->getAtom(AtomById(atomIds[ATOM_COUNT-1]));
     86  CPPUNIT_ASSERT(testAtom);
     87  CPPUNIT_ASSERT_EQUAL( atomIds[ATOM_COUNT-1], testAtom->getId());
    10388
     89  // find some ID that has not been created
     90  int outsideId =-1;
     91  bool res = false;
     92  while(!res) {
     93    ++outsideId;
     94    res = true;
     95    for(int i = 0; i < ATOM_COUNT; ++i){
     96      res &= atomIds[i]!=outsideId;
     97    }
     98  }
    10499  // test from outside of set
    105   testAtom = World::get()->getAtom(AtomById(ATOM_COUNT));
     100  testAtom = World::get()->getAtom(AtomById(outsideId));
    106101  CPPUNIT_ASSERT(!testAtom);
    107102}
     
    110105  {
    111106    std::vector<atom*> testAtoms = World::get()->getAllAtoms(AllAtoms()||NoAtoms());
    112     CPPUNIT_ASSERT_EQUAL( true , hasAll(testAtoms,0,ATOM_COUNT));
     107    CPPUNIT_ASSERT_EQUAL( true , hasAll(testAtoms,atomIds));
    113108    CPPUNIT_ASSERT_EQUAL( true , hasNoDuplicates(testAtoms));
    114109  }
     
    116111  {
    117112    std::vector<atom*> testAtoms = World::get()->getAllAtoms(NoAtoms()||AllAtoms());
    118     CPPUNIT_ASSERT_EQUAL( true , hasAll(testAtoms,0,ATOM_COUNT));
     113    CPPUNIT_ASSERT_EQUAL( true , hasAll(testAtoms,atomIds));
    119114    CPPUNIT_ASSERT_EQUAL( true , hasNoDuplicates(testAtoms));
    120115  }
     
    137132  {
    138133    std::vector<atom*> testAtoms = World::get()->getAllAtoms(!NoAtoms());
    139     CPPUNIT_ASSERT_EQUAL( true , hasAll(testAtoms,0,ATOM_COUNT));
     134    CPPUNIT_ASSERT_EQUAL( true , hasAll(testAtoms,atomIds));
    140135    CPPUNIT_ASSERT_EQUAL( true , hasNoDuplicates(testAtoms));
    141136  }
     
    143138  // exclude and include some atoms
    144139  {
    145     std::vector<atom*> testAtoms = World::get()->getAllAtoms(AllAtoms()&&(!AtomById(ATOM_COUNT/2)));
     140    std::vector<atom*> testAtoms = World::get()->getAllAtoms(AllAtoms()&&(!AtomById(atomIds[ATOM_COUNT/2])));
    146141    std::set<int> excluded;
    147     excluded.insert(ATOM_COUNT/2);
    148     CPPUNIT_ASSERT_EQUAL( true , hasAll(testAtoms,0,ATOM_COUNT,excluded));
     142    excluded.insert(atomIds[ATOM_COUNT/2]);
     143    CPPUNIT_ASSERT_EQUAL( true , hasAll(testAtoms,atomIds,excluded));
    149144    CPPUNIT_ASSERT_EQUAL( true , hasNoDuplicates(testAtoms));
    150145    CPPUNIT_ASSERT_EQUAL( (size_t)(ATOM_COUNT-1), testAtoms.size());
     
    152147
    153148  {
    154     std::vector<atom*> testAtoms = World::get()->getAllAtoms(NoAtoms()||(AtomById(ATOM_COUNT/2)));
     149    std::vector<atom*> testAtoms = World::get()->getAllAtoms(NoAtoms()||(AtomById(atomIds[ATOM_COUNT/2])));
    155150    CPPUNIT_ASSERT_EQUAL( (size_t)1, testAtoms.size());
    156     CPPUNIT_ASSERT_EQUAL( ATOM_COUNT/2, testAtoms[0]->getId());
     151    CPPUNIT_ASSERT_EQUAL( atomIds[ATOM_COUNT/2], testAtoms[0]->getId());
    157152  }
    158153}
  • src/unittests/DescriptorUnittest.hpp

    r326a43b rcbf01e  
    3333private:
    3434  atom *atoms [ATOM_COUNT];
     35  int atomIds [ATOM_COUNT];
    3536};
    3637
  • src/unittests/Makefile.am

    r326a43b rcbf01e  
    3131  CacheableTest \
    3232  DescriptorUnittest \
    33   ${MENUTESTS} 
    34    
     33  manipulateAtomsTest \
     34  atomsCalculationTest \
     35  ${MENUTESTS}
     36 
     37 
    3538check_PROGRAMS = $(TESTS)
    3639noinst_PROGRAMS = $(TESTS)
     
    109112
    110113DescriptorUnittest_SOURCES = DescriptorUnittest.cpp DescriptorUnittest.hpp
    111 DescriptorUnittest_LDADD = ${ALLLIBS}
     114DescriptorUnittest_LDADD = ${ALLLIBS}
     115
     116manipulateAtomsTest_SOURCES = manipulateAtomsTest.cpp manipulateAtomsTest.hpp
     117manipulateAtomsTest_LDADD = ${ALLLIBS}
     118
     119atomsCalculationTest_SOURCES = atomsCalculationTest.cpp atomsCalculationTest.hpp
     120atomsCalculationTest_LDADD = ${ALLLIBS}
    112121
    113122#AUTOMAKE_OPTIONS = parallel-tests
  • src/unittests/analysisbondsunittest.cpp

    r326a43b rcbf01e  
    1616#include <cstring>
    1717
     18#include "World.hpp"
    1819#include "analysis_bonds.hpp"
    1920#include "analysisbondsunittest.hpp"
     
    6263  // construct molecule (tetraeder of hydrogens)
    6364  TestMolecule = new molecule(tafel);
    64   Walker = new atom();
     65  Walker = World::get()->createAtom();
    6566  Walker->type = hydrogen;
    6667  Walker->node->Init(1.5, 0., 1.5 );
    6768  TestMolecule->AddAtom(Walker);
    68   Walker = new atom();
     69  Walker = World::get()->createAtom();
    6970  Walker->type = hydrogen;
    7071  Walker->node->Init(0., 1.5, 1.5 );
    7172  TestMolecule->AddAtom(Walker);
    72   Walker = new atom();
     73  Walker = World::get()->createAtom();
    7374  Walker->type = hydrogen;
    7475  Walker->node->Init(1.5, 1.5, 0. );
    7576  TestMolecule->AddAtom(Walker);
    76   Walker = new atom();
     77  Walker = World::get()->createAtom();
    7778  Walker->type = hydrogen;
    7879  Walker->node->Init(0., 0., 0. );
    7980  TestMolecule->AddAtom(Walker);
    80   Walker = new atom();
     81  Walker = World::get()->createAtom();
    8182  Walker->type = carbon;
    8283  Walker->node->Init(0.5, 0.5, 0.5 );
  • src/unittests/bondgraphunittest.cpp

    r326a43b rcbf01e  
    1616#include <cstring>
    1717
     18#include "World.hpp"
    1819#include "atom.hpp"
    1920#include "bond.hpp"
     
    5758  // construct molecule (tetraeder of hydrogens)
    5859  TestMolecule = new molecule(tafel);
    59   Walker = new atom();
     60  Walker = World::get()->createAtom();
    6061  Walker->type = hydrogen;
    6162  Walker->node->Init(1., 0., 1. );
    6263  TestMolecule->AddAtom(Walker);
    63   Walker = new atom();
     64  Walker = World::get()->createAtom();
    6465  Walker->type = hydrogen;
    6566  Walker->node->Init(0., 1., 1. );
    6667  TestMolecule->AddAtom(Walker);
    67   Walker = new atom();
     68  Walker = World::get()->createAtom();
    6869  Walker->type = hydrogen;
    6970  Walker->node->Init(1., 1., 0. );
    7071  TestMolecule->AddAtom(Walker);
    71   Walker = new atom();
     72  Walker = World::get()->createAtom();
    7273  Walker->type = hydrogen;
    7374  Walker->node->Init(0., 0., 0. );
  • src/unittests/listofbondsunittest.cpp

    r326a43b rcbf01e  
    1616#include "listofbondsunittest.hpp"
    1717
     18#include "World.hpp"
    1819#include "atom.hpp"
    1920#include "bond.hpp"
     
    5051  // construct molecule (tetraeder of hydrogens)
    5152  TestMolecule = new molecule(tafel);
    52   Walker = new atom();
     53  Walker = World::get()->createAtom();
    5354  Walker->type = hydrogen;
    5455  Walker->node->Init(1., 0., 1. );
    5556  TestMolecule->AddAtom(Walker);
    56   Walker = new atom();
     57  Walker = World::get()->createAtom();
    5758  Walker->type = hydrogen;
    5859  Walker->node->Init(0., 1., 1. );
    5960  TestMolecule->AddAtom(Walker);
    60   Walker = new atom();
     61  Walker = World::get()->createAtom();
    6162  Walker->type = hydrogen;
    6263  Walker->node->Init(1., 1., 0. );
    6364  TestMolecule->AddAtom(Walker);
    64   Walker = new atom();
     65  Walker = World::get()->createAtom();
    6566  Walker->type = hydrogen;
    6667  Walker->node->Init(0., 0., 0. );
     
    242243
    243244  // remove atom2
    244   delete(atom2);
     245  World::get()->destroyAtom(atom2);
    245246
    246247  // check bond if removed from other atom
Note: See TracChangeset for help on using the changeset viewer.