Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • molecuilder/src/Legacy/oldmenu.cpp

    r181488 r98a2987  
    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
     
    811812void oldmenu::ManipulateMolecules(periodentafel *periode, MoleculeListClass *molecules, config *configuration)
    812813{
    813   atom *first = NULL;
    814814  Vector x,y,z,n; // coordinates for absolute point in cell volume
    815   int j, axis, count, faktor;
    816815  char choice;  // menu choice char
    817816  molecule *mol = NULL;
    818   element **Elements;
    819   Vector **vectors;
    820817  MoleculeLeafClass *Subgraphs = NULL;
    821818
     
    10921089    A++;
    10931090  }
    1094   delete(mol);
     1091  World::get()->destroyMolecule(mol);
    10951092};
    10961093
Note: See TracChangeset for help on using the changeset viewer.