Changes in / [13e3c3:6b5657]


Ignore:
Files:
5 deleted
27 edited

Legend:

Unmodified
Added
Removed
  • src/Actions/AtomAction/AddAction.cpp

    r13e3c3 r6b5657  
    1515#include "Actions/AtomAction/AddAction.hpp"
    1616#include "Actions/ActionRegistry.hpp"
    17 #include "Descriptors/AtomIdDescriptor.hpp"
    1817#include "atom.hpp"
    1918#include "element.hpp"
     
    3231#include "UIElements/Dialog.hpp"
    3332#include "Actions/ValueStorage.hpp"
    34 
    35 // memento to remember the state when undoing
    36 
    37 class AtomAddState : public ActionState {
    38 public:
    39   AtomAddState(const Vector &_position, const element *_elemental, const atomId_t _id) :
    40     position(_position),
    41     elemental(_elemental),
    42     id(_id)
    43   {}
    44   Vector position;
    45   const element *elemental;
    46   atomId_t id;
    47 };
    4833
    4934const char AtomAddAction::NAME[] = "add-atom";
     
    9075    (*iter)->AddAtom(first);
    9176  }
    92   return Action::state_ptr(new AtomAddState(position, elemental, first->getId()));
     77  return Action::success;
    9378}
    9479
    9580Action::state_ptr AtomAddAction::performUndo(Action::state_ptr _state) {
    96   AtomAddState *state = assert_cast<AtomAddState*>(_state.get());
     81//  ParserLoadXyzState *state = assert_cast<ParserLoadXyzState*>(_state.get());
    9782
    98   DoLog(1) && (Log() << Verbose(1) << "Removing atom with id " << state->id << "." << endl);
    99   World::getInstance().destroyAtom(state->id);
    100 
    101   return Action::state_ptr(_state);
     83  return Action::failure;
     84//  string newName = state->mol->getName();
     85//  state->mol->setName(state->lastName);
     86//
     87//  return Action::state_ptr(new ParserLoadXyzState(state->mol,newName));
    10288}
    10389
    10490Action::state_ptr AtomAddAction::performRedo(Action::state_ptr _state){
    105   AtomAddState *state = assert_cast<AtomAddState*>(_state.get());
    106 
    107   atom * first = World::getInstance().createAtom();
    108   first->setType(state->elemental);
    109   first->setPosition(state->position);
    110   DoLog(1) && (Log() << Verbose(1) << "Re-adding new atom with element " << state->elemental->getName() << " at " << state->position << "." << endl);
    111   // TODO: remove when all of World's atoms are stored.
    112   std::vector<molecule *> molecules = World::getInstance().getAllMolecules();
    113   if (!molecules.empty()) {
    114     std::vector<molecule *>::iterator iter = molecules.begin();
    115     (*iter)->AddAtom(first);
    116   }
    117   if (first->getId() != state->id)
    118     if (!first->changeId(state->id))
    119       return Action::failure;
    120   return Action::state_ptr(_state);
     91  return Action::failure;
    12192}
    12293
    12394bool AtomAddAction::canUndo() {
    124   return true;
     95  return false;
    12596}
    12697
    12798bool AtomAddAction::shouldUndo() {
    128   return true;
     99  return false;
    129100}
    130101
  • src/Actions/AtomAction/ChangeElementAction.cpp

    r13e3c3 r6b5657  
    1515#include "Actions/AtomAction/ChangeElementAction.hpp"
    1616#include "Actions/ActionRegistry.hpp"
    17 #include "Descriptors/AtomIdDescriptor.hpp"
    1817#include "atom.hpp"
    1918#include "element.hpp"
     
    2524
    2625#include <iostream>
    27 #include <map>
    2826#include <string>
    2927
     
    3331#include "UIElements/Dialog.hpp"
    3432#include "Actions/ValueStorage.hpp"
    35 
    36 typedef std::map<int, const element *> ElementMap;
    37 
    38 // memento to remember the state when undoing
    39 
    40 class AtomChangeElementState : public ActionState {
    41 public:
    42   AtomChangeElementState(ElementMap _Elements, const element *_elemental) :
    43     Elements(_Elements),
    44     elemental(_elemental)
    45   {}
    46   ElementMap Elements;
    47   const element *elemental;
    48 };
    4933
    5034const char AtomChangeElementAction::NAME[] = "change-element";
     
    7761  ValueStorage::getInstance().queryCurrentValue(NAME, elemental);
    7862
    79   // create undo state
    80   ElementMap Elements;
    81   for (World::AtomSelectionIterator iter = World::getInstance().beginAtomSelection(); iter != World::getInstance().endAtomSelection(); ++iter) {
    82     Elements.insert(std::pair<int, const element *> (iter->second->getId(), iter->second->getType()));
    83   }
    84   AtomChangeElementState *UndoState = new AtomChangeElementState(Elements, elemental);
    85 
    8663  for (World::AtomSelectionIterator iter = World::getInstance().beginAtomSelection(); iter != World::getInstance().endAtomSelection(); ++iter) {
    8764    first = iter->second;
     
    9269    mol->AddAtom(first);  // add atom to ensure correctness of formula
    9370  }
    94   return Action::state_ptr(UndoState);
     71  return Action::success;
    9572}
    9673
    9774Action::state_ptr AtomChangeElementAction::performUndo(Action::state_ptr _state) {
    98   AtomChangeElementState *state = assert_cast<AtomChangeElementState*>(_state.get());
    99   atom *first = NULL;
    100   molecule *mol = NULL;
     75//  ParserLoadXyzState *state = assert_cast<ParserLoadXyzState*>(_state.get());
    10176
    102   for(ElementMap::const_iterator iter = state->Elements.begin(); iter != state->Elements.end(); ++iter) {
    103     first = World::getInstance().getAtom(AtomById(iter->first));
    104     mol = first->getMolecule();
    105     first->removeFromMolecule(); // remove atom
    106     first->setType(iter->second);
    107     mol->AddAtom(first);  // add atom to ensure correctness of formula
    108   }
    109 
    110   return Action::state_ptr(_state);
     77  return Action::failure;
     78//  string newName = state->mol->getName();
     79//  state->mol->setName(state->lastName);
     80//
     81//  return Action::state_ptr(new ParserLoadXyzState(state->mol,newName));
    11182}
    11283
    11384Action::state_ptr AtomChangeElementAction::performRedo(Action::state_ptr _state){
    114   AtomChangeElementState *state = assert_cast<AtomChangeElementState*>(_state.get());
    115   atom *first = NULL;
    116   molecule *mol = NULL;
    117 
    118   for(ElementMap::const_iterator iter = state->Elements.begin(); iter != state->Elements.end(); ++iter) {
    119     first = World::getInstance().getAtom(AtomById(iter->first));
    120     mol = first->getMolecule();
    121     first->removeFromMolecule(); // remove atom
    122     first->setType(state->elemental);
    123     mol->AddAtom(first);  // add atom to ensure correctness of formula
    124   }
    125 
    126   return Action::state_ptr(_state);
     85  return Action::failure;
    12786}
    12887
    12988bool AtomChangeElementAction::canUndo() {
    130   return true;
     89  return false;
    13190}
    13291
    13392bool AtomChangeElementAction::shouldUndo() {
    134   return true;
     93  return false;
    13594}
    13695
  • src/Actions/AtomAction/RemoveAction.cpp

    r13e3c3 r6b5657  
    1616#include "Actions/ActionRegistry.hpp"
    1717#include "atom.hpp"
    18 #include "AtomicInfo.hpp"
    1918#include "Descriptors/AtomDescriptor.hpp"
    2019#include "Helpers/Log.hpp"
     
    3130#include "UIElements/Dialog.hpp"
    3231#include "Actions/ValueStorage.hpp"
    33 
    34 // memento to remember the state when undoing
    35 
    36 class AtomRemoveState : public ActionState {
    37 public:
    38   AtomRemoveState(std::vector<AtomicInfo> _Walkers) :
    39     Walkers(_Walkers)
    40   {}
    41   std::vector<AtomicInfo> Walkers;
    42 };
    4332
    4433const char AtomRemoveAction::NAME[] = "remove-atom";
     
    6655  atom *first = NULL;
    6756
    68   // create undo state
    69   std::vector<AtomicInfo> Walkers;
    70   for (World::AtomSelectionIterator iter = World::getInstance().beginAtomSelection(); iter != World::getInstance().endAtomSelection(); ++iter) {
    71     Walkers.push_back(AtomicInfo(*(iter->second)));
    72   }
    73   AtomRemoveState *UndoState = new AtomRemoveState(Walkers);
    74 
    75   // remove all selected atoms
    76 //  std::vector<molecule *> molecules = World::getInstance().getAllMolecules();
     57  std::vector<molecule *> molecules = World::getInstance().getAllMolecules();
    7758  for (World::AtomSelectionIterator iter = World::getInstance().beginAtomSelection(); iter != World::getInstance().endAtomSelection(); ++iter) {
    7859    first = iter->second;
    7960    DoLog(1) && (Log() << Verbose(1) << "Removing atom " << first->getId() << "." << endl);
    80 //    // TODO: this is not necessary when atoms and their storing to file are handled by the World
    81 //    // simply try to erase in every molecule found
    82 //    for (std::vector<molecule *>::iterator iter = molecules.begin();iter != molecules.end(); ++iter) {
    83 //      (*iter)->erase(first);
    84 //    }
     61    // TODO: this is not necessary when atoms and their storing to file are handled by the World
     62    // simply try to erase in every molecule found
     63    for (std::vector<molecule *>::iterator iter = molecules.begin();iter != molecules.end(); ++iter) {
     64      (*iter)->erase(first);
     65    }
    8566    World::getInstance().destroyAtom(first);
    8667  }
    87   return Action::state_ptr(UndoState);
     68  return Action::success;
    8869}
    8970
    9071Action::state_ptr AtomRemoveAction::performUndo(Action::state_ptr _state) {
    91   AtomRemoveState *state = assert_cast<AtomRemoveState*>(_state.get());
     72//  ParserLoadXyzState *state = assert_cast<ParserLoadXyzState*>(_state.get());
    9273
    93   size_t i=0;
    94   for (; i<state->Walkers.size(); ++i) {
    95     // re-create the atom
    96     DoLog(1) && (Log() << Verbose(1) << "Re-adding atom " << state->Walkers[i].getId() << "." << endl);
    97     atom *Walker = World::getInstance().createAtom();
    98     if (!state->Walkers[i].setAtom(*Walker)) {
    99       DoeLog(1) && (eLog() << Verbose(1) << "Failed to set id." << endl);
    100       World::getInstance().destroyAtom(Walker);
    101       break;
    102     }
    103   }
    104   if (i<state->Walkers.size()) {
    105     // remove all previous ones, too
    106     for (size_t j=0;j<i;++j)
    107       World::getInstance().destroyAtom(state->Walkers[j].getId());
    108     // and announce the failure of the undo
    109     return Action::failure;
    110   }
    111   return Action::state_ptr(_state);
     74  return Action::failure;
     75//  string newName = state->mol->getName();
     76//  state->mol->setName(state->lastName);
     77//
     78//  return Action::state_ptr(new ParserLoadXyzState(state->mol,newName));
    11279}
    11380
    11481Action::state_ptr AtomRemoveAction::performRedo(Action::state_ptr _state){
    115   AtomRemoveState *state = assert_cast<AtomRemoveState*>(_state.get());
    116 
    117   // simple remove again all previously added atoms
    118   for (size_t i=0; i<state->Walkers.size(); ++i) {
    119     DoLog(1) && (Log() << Verbose(1) << "Re-removing atom " << state->Walkers[i].getId() << "." << endl);
    120     World::getInstance().destroyAtom(state->Walkers[i].getId());
    121   }
    122 
    123   return Action::state_ptr(_state);
     82  return Action::failure;
    12483}
    12584
    12685bool AtomRemoveAction::canUndo() {
    127   return true;
     86  return false;
    12887}
    12988
    13089bool AtomRemoveAction::shouldUndo() {
    131   return true;
     90  return false;
    13291}
    13392
  • src/Actions/CmdAction/FastParsingAction.cpp

    r13e3c3 r6b5657  
    3333class CommandLineFastParsingState : public ActionState {
    3434public:
    35   CommandLineFastParsingState(const bool _oldvalue, const bool _newvalue) :
    36     oldvalue(_oldvalue),
    37     newvalue(_newvalue)
     35  CommandLineFastParsingState(bool _bool) :
     36    boolean(_bool)
    3837  {}
    39   bool oldvalue;
    40   bool newvalue;
     38  bool boolean;
    4139};
    4240
     
    6563
    6664Action::state_ptr CommandLineFastParsingAction::performCall() {
     65
    6766  config *configuration = World::getInstance().getConfig();
    68   bool oldvalue = configuration->FastParsing;
    69   bool newvalue;
    70   ValueStorage::getInstance().queryCurrentValue(NAME, newvalue);
    71   configuration->FastParsing = newvalue;
     67  ValueStorage::getInstance().queryCurrentValue(NAME, configuration->FastParsing);
    7268  if (configuration->FastParsing)
    7369    DoLog(0) && (Log() << Verbose(0) << "I won't parse trajectories." << endl);
    7470  else
    7571    DoLog(0) && (Log() << Verbose(0) << "I will parse trajectories." << endl);
    76   return Action::state_ptr(new CommandLineFastParsingState(oldvalue, newvalue));
     72  return Action::success;
    7773}
    7874
     
    8177
    8278  config *configuration = World::getInstance().getConfig();
    83   configuration->FastParsing = state->oldvalue;
    84   if (configuration->FastParsing)
    85     DoLog(0) && (Log() << Verbose(0) << "I won't parse trajectories." << endl);
    86   else
    87     DoLog(0) && (Log() << Verbose(0) << "I will parse trajectories." << endl);
     79  configuration->FastParsing = state->boolean;
    8880
    89   return Action::state_ptr(_state);
     81  return Action::state_ptr(new CommandLineFastParsingState(!state->boolean));
    9082}
    9183
    9284Action::state_ptr CommandLineFastParsingAction::performRedo(Action::state_ptr _state){
    93   CommandLineFastParsingState *state = assert_cast<CommandLineFastParsingState*>(_state.get());
    94 
    95   config *configuration = World::getInstance().getConfig();
    96   configuration->FastParsing = state->newvalue;
    97   if (configuration->FastParsing)
    98     DoLog(0) && (Log() << Verbose(0) << "I won't parse trajectories." << endl);
    99   else
    100     DoLog(0) && (Log() << Verbose(0) << "I will parse trajectories." << endl);
    101 
    102   return Action::state_ptr(_state);
     85  return performUndo(_state);
    10386}
    10487
  • src/Actions/CmdAction/VerboseAction.cpp

    r13e3c3 r6b5657  
    3131class CommandLineVerboseState : public ActionState {
    3232public:
    33   CommandLineVerboseState(const int _oldverbosity, const int _newverbosity) :
    34     oldverbosity(_oldverbosity),
    35     newverbosity(_newverbosity)
     33  CommandLineVerboseState(int _verbosity) :
     34    verbosity(_verbosity)
    3635  {}
    37   int oldverbosity;
    38   int newverbosity;
     36  int verbosity;
    3937};
    4038
     
    6361
    6462Action::state_ptr CommandLineVerboseAction::performCall() {
    65   int oldverbosity = getVerbosity();
    66   int newverbosity = 2;
     63  int verbosity = 2;
    6764
    68   ValueStorage::getInstance().queryCurrentValue(NAME, newverbosity);
     65  ValueStorage::getInstance().queryCurrentValue(NAME, verbosity);
    6966
    70   if (oldverbosity != newverbosity) {
    71     CommandLineVerboseState *UndoState = new CommandLineVerboseState(oldverbosity, newverbosity);
    72     setVerbosity(newverbosity);
    73     DoLog(0) && (Log() << Verbose(0) << "Setting verbosity from " << oldverbosity << " to " << newverbosity << "." << endl);
    74     return Action::state_ptr(UndoState);
    75   } else {
    76     DoLog(0) && (Log() << Verbose(0) << "Verbosity remains unchanged at " << oldverbosity << "." << endl);
    77     return Action::failure;
    78   }
     67  setVerbosity(verbosity);
     68  DoLog(0) && (Log() << Verbose(0) << "Setting verbosity to " << verbosity << "." << endl);
     69  return Action::success;
    7970}
    8071
     
    8273  CommandLineVerboseState *state = assert_cast<CommandLineVerboseState*>(_state.get());
    8374
    84   DoLog(0) && (Log() << Verbose(0) << "Setting verbosity from " << state->newverbosity << " to " << state->oldverbosity << "." << endl);
    85   setVerbosity(state->oldverbosity);
     75  int verbosity = 2;
     76  ValueStorage::getInstance().queryCurrentValue(NAME, verbosity);
    8677
    87   return Action::state_ptr(_state);
     78  setVerbosity(state->verbosity);
     79  return Action::state_ptr(new CommandLineVerboseState(verbosity));
    8880}
    8981
    9082Action::state_ptr CommandLineVerboseAction::performRedo(Action::state_ptr _state){
    91   CommandLineVerboseState *state = assert_cast<CommandLineVerboseState*>(_state.get());
    92 
    93   DoLog(0) && (Log() << Verbose(0) << "Setting verbosity from " << state->oldverbosity << " to " << state->newverbosity << "." << endl);
    94   setVerbosity(state->newverbosity);
    95 
    96   return Action::state_ptr(_state);
     83  return performUndo(_state);
    9784}
    9885
  • src/Actions/WorldAction/SetDefaultNameAction.cpp

    r13e3c3 r6b5657  
    6767
    6868  defaultname = World::getInstance().getDefaultName();
    69   WorldSetDefaultNameState *UndoState = new WorldSetDefaultNameState(defaultname);
    7069  ValueStorage::getInstance().queryCurrentValue(NAME, defaultname);
    7170
    7271  World::getInstance().setDefaultName(defaultname);
    7372  DoLog(0) && (Log() << Verbose(0) << "Default name of new molecules set to " << World::getInstance().getDefaultName() << "." << endl);
    74   return Action::state_ptr(UndoState);
     73  return Action::success;
    7574}
    7675
     
    8079  string newName = World::getInstance().getDefaultName();
    8180  World::getInstance().setDefaultName(state->lastName);
    82   DoLog(0) && (Log() << Verbose(0) << "Default name of new molecules set to " << World::getInstance().getDefaultName() << "." << endl);
    8381
    8482  return Action::state_ptr(new WorldSetDefaultNameState(newName));
  • src/Helpers/Log.cpp

    r13e3c3 r6b5657  
    2323void setVerbosity(int verbosityLevel) {
    2424  logger::getInstance().setVerbosity(verbosityLevel);
    25 }
    26 
    27 /**
    28  * Gets verbosity for the error logger and the standard logger.
    29  *
    30  * \param int verbosity level
    31  */
    32 int getVerbosity() {
    33   return logger::getInstance().getVerbosity();
    3425}
    3526
  • src/Helpers/Log.hpp

    r13e3c3 r6b5657  
    1515class errorLogger & eLog();
    1616void setVerbosity(int verbosityLevel);
    17 int getVerbosity();
    1817bool DoLog(int verbose);
    1918bool DoeLog(int verbose);
  • src/Helpers/errorlogger.cpp

    r13e3c3 r6b5657  
    4646void errorLogger::setVerbosity(int verbosityLevel) {
    4747  verbosity = verbosityLevel;
    48 }
    49 
    50 /**
    51  * Gets the verbosity.
    52  *
    53  * \return verbosity level
    54  */
    55 int errorLogger::getVerbosity()
    56 {
    57   return verbosity;
    5848}
    5949
  • src/Helpers/errorlogger.hpp

    r13e3c3 r6b5657  
    2525  static bool DoOutput();
    2626  static void setVerbosity(int verbosityLevel);
    27   static int getVerbosity();
    2827
    2928protected:
  • src/Helpers/logger.cpp

    r13e3c3 r6b5657  
    4949
    5050/**
    51  * Gets the verbosity.
    52  *
    53  * \return verbosity level
    54  */
    55 int logger::getVerbosity()
    56 {
    57   return verbosity;
    58 }
    59 
    60 /**
    6151 * Operator for the Binary(arg) call.
    6252 * Constructs temporary a Verbose class object, wherein the Binary is stored.
  • src/Helpers/logger.hpp

    r13e3c3 r6b5657  
    2525  static bool DoOutput();
    2626  static void setVerbosity(int verbosityLevel);
    27   static int getVerbosity();
    2827
    2928protected:
  • src/Makefile.am

    r13e3c3 r6b5657  
    66ATOMSOURCE = \
    77  atom.cpp \
    8   AtomicInfo.cpp \
    98  atom_atominfo.cpp \
    109  atom_bondedparticle.cpp \
     
    1716ATOMHEADER = \
    1817  atom.hpp \
    19   AtomicInfo.hpp \
    2018  atom_atominfo.hpp \
    2119  atom_bondedparticle.hpp \
  • src/Shapes/BaseShapes.cpp

    r13e3c3 r6b5657  
    1616#include "Shapes/BaseShapes_impl.hpp"
    1717
    18 #include <cmath>
    19 
    20 #include "Helpers/Assert.hpp"
    2118#include "LinearAlgebra/Vector.hpp"
    2219
     
    2421  return point.NormSquared()<=1;
    2522}
    26 
    27 
    28 /**
    29  * algorithm taken from http://www.cgafaq.info/wiki/Evenly_distributed_points_on_sphere
    30  * \param N number of points on surface
    31  */
    32 std::vector<Vector> Sphere_impl::getHomogeneousPointsOnSurface(const int N) const {
    33   std::vector<Vector> PointsOnSurface;
    34 
    35   const double dlength = M_PI*(3.-sqrt(5.));
    36   double length = 0;
    37   const double dz = 2.0/N;
    38   double z = 1. - dz/2.;
    39   Vector point;
    40   for (int ka = 0; ka<N; ka++){
    41     const double r = sqrt(1.-z*z);
    42     point.Zero();
    43     point[0] = cos(length)*r;
    44     point[1] = sin(length)*r;
    45     point[2] = z;
    46     PointsOnSurface.push_back(point);
    47     z = z - dz;
    48     length = length + dlength;
    49   }
    50 
    51   ASSERT(PointsOnSurface.size() == N, "Sphere_impl::getHomogeneousPointsOnSurface() did not create enough points.");
    52   return PointsOnSurface;
    53 }
    54 
    5523
    5624Shape Sphere(){
     
    6028
    6129bool Cuboid_impl::isInside(const Vector &point){
    62   return (point[0]>=0 && point[0]<=1) && (point[1]>=0 && point[1]<=1) && (point[2]>=0 && point[2]<=1);
    63 }
    64 
    65 /**
    66  * \param N number of points on surface
    67  */
    68 std::vector<Vector> Cuboid_impl::getHomogeneousPointsOnSurface(const int N) const {
    69   std::vector<Vector> PointsOnSurface;
    70   ASSERT(false, "Cuboid_impl::getHomogeneousPointsOnSurface() not implemented yet");
    71   return PointsOnSurface;
     30  return point[0]<=1 && point[1]<=1 && point[2]<=1;
    7231}
    7332
    7433Shape Cuboid(){
    75   Shape::impl_ptr impl = Shape::impl_ptr(new Cuboid_impl());
     34  Shape::impl_ptr impl = Shape::impl_ptr(new Sphere_impl());
    7635  return Shape(impl);
    7736}
  • src/Shapes/BaseShapes_impl.hpp

    r13e3c3 r6b5657  
    1313class Sphere_impl : public Shape_impl {
    1414  virtual bool isInside(const Vector &point);
    15   virtual std::vector<Vector> getHomogeneousPointsOnSurface(const int N) const;
    1615};
    1716
    1817class Cuboid_impl : public Shape_impl {
    1918  virtual bool isInside(const Vector &point);
    20   virtual std::vector<Vector> getHomogeneousPointsOnSurface(const int N) const;
    2119};
    2220
  • src/Shapes/Shape.cpp

    r13e3c3 r6b5657  
    1616#include "Shape_impl.hpp"
    1717
    18 
    19 #include "Helpers/Assert.hpp"
    20 #include "LinearAlgebra/Vector.hpp"
    21 
    2218Shape::Shape(const Shape& src) :
    2319  impl(src.getImpl())
     
    2824bool Shape::isInside(const Vector &point) const{
    2925  return impl->isInside(point);
    30 }
    31 
    32 std::vector<Vector> Shape::getHomogeneousPointsOnSurface(const int N) const {
    33   return impl->getHomogeneousPointsOnSurface(N);
    3426}
    3527
     
    8072}
    8173
    82 std::vector<Vector> AndShape_impl::getHomogeneousPointsOnSurface(const int N) const {
    83   std::vector<Vector> PointsOnSurface_lhs = lhs->getHomogeneousPointsOnSurface(N);
    84   std::vector<Vector> PointsOnSurface_rhs = rhs->getHomogeneousPointsOnSurface(N);
    85   std::vector<Vector> PointsOnSurface;
    86 
    87   for (std::vector<Vector>::const_iterator iter = PointsOnSurface_lhs.begin(); iter != PointsOnSurface_lhs.end(); ++iter) {
    88     if (rhs->isInside(*iter))
    89       PointsOnSurface.push_back(*iter);
    90   }
    91   for (std::vector<Vector>::const_iterator iter = PointsOnSurface_rhs.begin(); iter != PointsOnSurface_rhs.end(); ++iter) {
    92     if (lhs->isInside(*iter))
    93       PointsOnSurface.push_back(*iter);
    94   }
    95 
    96   return PointsOnSurface;
    97 }
    98 
    99 
    10074Shape operator&&(const Shape &lhs,const Shape &rhs){
    10175  Shape::impl_ptr newImpl = Shape::impl_ptr(new AndShape_impl(getShapeImpl(lhs),getShapeImpl(rhs)));
     
    11387bool OrShape_impl::isInside(const Vector &point){
    11488  return rhs->isInside(point) || lhs->isInside(point);
    115 }
    116 
    117 std::vector<Vector> OrShape_impl::getHomogeneousPointsOnSurface(const int N) const {
    118   std::vector<Vector> PointsOnSurface_lhs = lhs->getHomogeneousPointsOnSurface(N);
    119   std::vector<Vector> PointsOnSurface_rhs = rhs->getHomogeneousPointsOnSurface(N);
    120   std::vector<Vector> PointsOnSurface;
    121 
    122   for (std::vector<Vector>::const_iterator iter = PointsOnSurface_lhs.begin(); iter != PointsOnSurface_lhs.end(); ++iter) {
    123     if (!rhs->isInside(*iter))
    124       PointsOnSurface.push_back(*iter);
    125   }
    126   for (std::vector<Vector>::const_iterator iter = PointsOnSurface_rhs.begin(); iter != PointsOnSurface_rhs.end(); ++iter) {
    127     if (!lhs->isInside(*iter))
    128       PointsOnSurface.push_back(*iter);
    129   }
    130 
    131   return PointsOnSurface;
    13289}
    13390
     
    149106}
    150107
    151 std::vector<Vector> NotShape_impl::getHomogeneousPointsOnSurface(const int N) const {
    152   // surfaces are the same, only normal direction is different
    153   return arg->getHomogeneousPointsOnSurface(N);
    154 }
    155 
    156108Shape operator!(const Shape &arg){
    157109  Shape::impl_ptr newImpl = Shape::impl_ptr(new NotShape_impl(getShapeImpl(arg)));
  • src/Shapes/Shape.hpp

    r13e3c3 r6b5657  
    1010
    1111#include <boost/shared_ptr.hpp>
    12 
    13 #include <vector>
    1412
    1513class Vector;
     
    2725
    2826  bool isInside(const Vector &point) const;
    29   std::vector<Vector> getHomogeneousPointsOnSurface(const int N) const;
    3027
    3128  Shape &operator=(const Shape& rhs);
  • src/Shapes/ShapeOps.cpp

    r13e3c3 r6b5657  
    3232}
    3333
    34 std::vector<Vector> Resize_impl::getHomogeneousPointsOnSurface(const int N) const {
    35   std::vector<Vector> PointsOnSurface = arg->getHomogeneousPointsOnSurface(N);
    36   for(std::vector<Vector>::iterator iter = PointsOnSurface.begin(); iter != PointsOnSurface.end(); ++iter) {
    37     *iter *= size;
    38   }
    39   return PointsOnSurface;
    40 }
    41 
    42 
    4334Shape resize(const Shape &arg,double size){
    4435  Shape::impl_ptr impl = Shape::impl_ptr(new Resize_impl(getShapeImpl(arg),size));
     
    5647bool Translate_impl::isInside(const Vector& point){
    5748  return arg->isInside(point-offset);
    58 }
    59 
    60 std::vector<Vector> Translate_impl::getHomogeneousPointsOnSurface(const int N) const {
    61   std::vector<Vector> PointsOnSurface = arg->getHomogeneousPointsOnSurface(N);
    62   for(std::vector<Vector>::iterator iter = PointsOnSurface.begin(); iter != PointsOnSurface.end(); ++iter) {
    63     *iter += offset;
    64   }
    65   return PointsOnSurface;
    6649}
    6750
     
    9275}
    9376
    94 std::vector<Vector> Stretch_impl::getHomogeneousPointsOnSurface(const int N) const {
    95   std::vector<Vector> PointsOnSurface = arg->getHomogeneousPointsOnSurface(N);
    96   for(std::vector<Vector>::iterator iter = PointsOnSurface.begin(); iter != PointsOnSurface.end(); ++iter) {
    97     (*iter).ScaleAll(reciFactors);
    98   }
    99   return PointsOnSurface;
    100 }
    101 
    10277Shape stretch(const Shape &arg, const Vector &factors){
    10378  Shape::impl_ptr impl = Shape::impl_ptr(new Stretch_impl(getShapeImpl(arg),factors));
     
    11994}
    12095
    121 std::vector<Vector> Transform_impl::getHomogeneousPointsOnSurface(const int N) const {
    122   std::vector<Vector> PointsOnSurface = arg->getHomogeneousPointsOnSurface(N);
    123   for(std::vector<Vector>::iterator iter = PointsOnSurface.begin(); iter != PointsOnSurface.end(); ++iter) {
    124     *iter = transformation * (*iter);
    125   }
    126   return PointsOnSurface;
    127 }
    128 
    12996Shape transform(const Shape &arg, const Matrix &transformation){
    13097  Shape::impl_ptr impl = Shape::impl_ptr(new Transform_impl(getShapeImpl(arg),transformation));
  • src/Shapes/ShapeOps_impl.hpp

    r13e3c3 r6b5657  
    1919  virtual ~Resize_impl();
    2020  virtual bool isInside(const Vector& point);
    21   virtual std::vector<Vector> getHomogeneousPointsOnSurface(const int N) const;
    2221private:
    2322  Shape::impl_ptr arg;
     
    3130  virtual ~Translate_impl();
    3231  virtual bool isInside(const Vector& point);
    33   virtual std::vector<Vector> getHomogeneousPointsOnSurface(const int N) const;
    3432private:
    3533  Shape::impl_ptr arg;
     
    4341  virtual ~Stretch_impl();
    4442  virtual bool isInside(const Vector& point);
    45   virtual std::vector<Vector> getHomogeneousPointsOnSurface(const int N) const;
    4643private:
    4744  Shape::impl_ptr arg;
     
    5653  virtual ~Transform_impl();
    5754  virtual bool isInside(const Vector& point);
    58   virtual std::vector<Vector> getHomogeneousPointsOnSurface(const int N) const;
    5955private:
    6056  Shape::impl_ptr arg;
  • src/Shapes/Shape_impl.hpp

    r13e3c3 r6b5657  
    99#define SHAPE_IMPL_HPP_
    1010
    11 #include <vector>
    12 
    1311#include "Shapes/Shape.hpp"
    14 
    15 class Vector;
    1612
    1713class Shape_impl {
     
    2016  virtual ~Shape_impl(){};
    2117  virtual bool isInside(const Vector &point)=0;
    22   virtual std::vector<Vector> getHomogeneousPointsOnSurface(const int N) const=0;
    2318};
    2419
     
    2823    return true;
    2924  }
    30   virtual std::vector<Vector> getHomogeneousPointsOnSurface(const int N) const {
    31     std::vector<Vector> PointsOnSurface;
    32     return PointsOnSurface;
    33   }
    3425};
    3526
     
    3728  virtual bool isInside(const Vector &point){
    3829    return false;
    39   }
    40   virtual std::vector<Vector> getHomogeneousPointsOnSurface(const int N) const {
    41     std::vector<Vector> PointsOnSurface;
    42     return PointsOnSurface;
    4330  }
    4431};
     
    4936  virtual ~AndShape_impl();
    5037  virtual bool isInside(const Vector &point);
    51   virtual std::vector<Vector> getHomogeneousPointsOnSurface(const int N) const;
    5238private:
    5339  Shape::impl_ptr lhs;
     
    6046  virtual ~OrShape_impl();
    6147  virtual bool isInside(const Vector &point);
    62   virtual std::vector<Vector> getHomogeneousPointsOnSurface(const int N) const;
    6348private:
    6449  Shape::impl_ptr lhs;
     
    7156  virtual ~NotShape_impl();
    7257  virtual bool isInside(const Vector &point);
    73   virtual std::vector<Vector> getHomogeneousPointsOnSurface(const int N) const;
    7458private:
    7559  Shape::impl_ptr arg;
  • src/atom.cpp

    r13e3c3 r6b5657  
    358358}
    359359
    360 molecule* atom::getMolecule() const {
     360molecule* atom::getMolecule(){
    361361  return mol;
    362362}
  • src/atom.hpp

    r13e3c3 r6b5657  
    9292
    9393   void setMolecule(molecule*);
    94    molecule* getMolecule() const;
     94   molecule* getMolecule();
    9595   void removeFromMolecule();
    9696
  • src/unittests/Makefile.am

    r13e3c3 r6b5657  
    1616  atomsCalculationTest \
    1717  AtomDescriptorTest \
    18   BaseShapesUnitTest \
    1918  BondGraphUnitTest \
    2019  BoxUnittest \
     
    7473  AtomDescriptorTest.cpp \
    7574  atomsCalculationTest.cpp \
    76   BaseShapesUnittest.cpp \
    7775  bondgraphunittest.cpp \
    7876  BoxUnittest.cpp \
     
    113111  AtomDescriptorTest.hpp \
    114112  atomsCalculationTest.hpp \
    115   BaseShapesUnittest.hpp \
    116113  bondgraphunittest.hpp \
    117114  BoxUnittest.hpp \
     
    167164AtomDescriptorTest_LDADD = ${ALLLIBS}
    168165
    169 BaseShapesUnitTest_SOURCES = UnitTestMain.cpp BaseShapesUnittest.cpp BaseShapesUnittest.hpp
    170 BaseShapesUnitTest_LDADD = ${ALLLIBS}
    171 
    172166BondGraphUnitTest_SOURCES = UnitTestMain.cpp bondgraphunittest.cpp bondgraphunittest.hpp
    173167BondGraphUnitTest_LDADD = ${ALLLIBS}
  • src/unittests/ShapeUnittest.cpp

    r13e3c3 r6b5657  
    1717#include <cppunit/ui/text/TestRunner.h>
    1818
    19 #include <cmath>
    20 
    2119#ifdef HAVE_TESTRUNNER
    2220#include "UnitTestMain.hpp"
     
    2523#include "LinearAlgebra/Vector.hpp"
    2624#include "Shapes/Shape.hpp"
    27 
    28 #include "Shapes/BaseShapes.hpp"
    2925
    3026// Registers the fixture into the 'registry'
     
    188184
    189185}
    190 
    191186void ShapeUnittest::operatorTest(){
    192187  {
  • tests/regression/Simple_configuration/5/pre/test.conf

    r13e3c3 r6b5657  
    2828OutSrcStep      5       # Output "restart" data every ..th step
    2929TargetTemp      0.000950045     # Target temperature
    30 MaxPsiStep      3       # number of Minimisation steps per state (0 - default)
     30MaxPsiStep      0       # number of Minimisation steps per state (0 - default)
    3131EpsWannier      1e-07   # tolerance value for spread minimisation of orbitals
    3232
     
    3535RelEpsTotalE    1e-07   # relative change in total energy
    3636RelEpsKineticE  1e-05   # relative change in kinetic energy
    37 MaxMinStopStep  1       # check every ..th steps
    38 MaxMinGapStopStep       1       # check every ..th steps
     37MaxMinStopStep  0       # check every ..th steps
     38MaxMinGapStopStep       0       # check every ..th steps
    3939
    4040# Values specifying when to stop for INIT, otherwise same as above
     
    4242InitRelEpsTotalE        1e-05   # relative change in total energy
    4343InitRelEpsKineticE      0.0001  # relative change in kinetic energy
    44 InitMaxMinStopStep      1       # check every ..th steps
    45 InitMaxMinGapStopStep   1       # check every ..th steps
     44InitMaxMinStopStep      0       # check every ..th steps
     45InitMaxMinGapStopStep   0       # check every ..th steps
    4646
    4747BoxLength                       # (Length of a unit cell)
     
    5454Level0Factor    2       # factor by which node number increases from S to 0 level
    5555RiemannTensor   0       # (Use metric)
    56 PsiType         1       # 0 - doubly occupied, 1 - SpinUp,SpinDown
     56PsiType         0       # 0 - doubly occupied, 1 - SpinUp,SpinDown
    5757MaxPsiDouble    0       # here: specifying both maximum number of SpinUp- and -Down-states
    5858PsiMaxNoUp      0       # here: specifying maximum number of SpinUp-states
    59 PsiMaxNoDown    1       # here: specifying maximum number of SpinDown-states
     59PsiMaxNoDown    0       # here: specifying maximum number of SpinDown-states
    6060AddPsis         0       # Additional unoccupied Psis for bandgap determination
    6161
  • tests/regression/testsuite-simple_configuration.at

    r13e3c3 r6b5657  
    3131AT_CHECK([../../molecuilder -i test2.conf -e ${abs_top_srcdir}/src/ -o mpqc pcp xyz -a 1 --position "0., 0., -1."], 134, [ignore], [ignore])
    3232AT_CLEANUP
    33 AT_SETUP([Simple configuration - adding atom with Undo/Redo])
    34 AT_KEYWORDS([configuration])
    35 AT_CHECK([../../molecuilder -i empty.conf -o pcp -a 1 --position "10., 10., 10." --undo], 0, [ignore], [ignore])
    36 AT_CHECK([file=empty.conf; diff $file ${abs_top_srcdir}/${AUTOTEST_PATH}/Simple_configuration/3/post/$file], 0, [ignore], [ignore])
    37 AT_CHECK([../../molecuilder -i test.conf -o mpqc pcp xyz -a 1 --position "10., 10., 10." --undo --redo], 0, [ignore], [ignore])
    38 AT_CHECK([file=test.conf; diff $file ${abs_top_srcdir}/${AUTOTEST_PATH}/Simple_configuration/3/post/$file], 0, [ignore], [ignore])
    39 AT_CHECK([file=test.in; diff $file ${abs_top_srcdir}/${AUTOTEST_PATH}/Simple_configuration/3/post/$file], 0, [ignore], [ignore])
    40 AT_CHECK([file=test.xyz; diff -I '.*Created by molecuilder.*' $file ${abs_top_srcdir}/${AUTOTEST_PATH}/Simple_configuration/3/post/$file], 0, [ignore], [ignore])
    41 AT_CLEANUP
    4233
    4334# 4. change the element
     
    4637AT_CHECK([/bin/cp -f ${abs_top_srcdir}/${AUTOTEST_PATH}/Simple_configuration/4/pre/test.xyz test.xyz], 0)
    4738AT_CHECK([../../molecuilder -i test.xyz -e ${abs_top_srcdir}/src/ --select-atom-by-id 0 -E 6 ], 0, [ignore], [ignore])
    48 AT_CHECK([file=test.xyz; diff $file ${abs_top_srcdir}/${AUTOTEST_PATH}/Simple_configuration/4/post/$file], 0, [ignore], [ignore])
    49 AT_CLEANUP
    50 AT_SETUP([Simple configuration - Changing element with Undo/Redo])
    51 AT_KEYWORDS([configuration])
    52 AT_CHECK([/bin/cp -f ${abs_top_srcdir}/${AUTOTEST_PATH}/Simple_configuration/4/pre/test.xyz test.xyz], 0)
    53 AT_CHECK([../../molecuilder -i test.xyz -e ${abs_top_srcdir}/src/ --select-atom-by-id 0 -E 6 --undo], 0, [ignore], [ignore])
    54 AT_CHECK([file=test.xyz; diff $file ${abs_top_srcdir}/${AUTOTEST_PATH}/Simple_configuration/4/pre/$file], 0, [ignore], [ignore])
    55 AT_CHECK([/bin/cp -f ${abs_top_srcdir}/${AUTOTEST_PATH}/Simple_configuration/4/pre/test.xyz test.xyz], 0)
    56 AT_CHECK([../../molecuilder -i test.xyz -e ${abs_top_srcdir}/src/ --select-atom-by-id 0 -E 6 --undo --redo], 0, [ignore], [ignore])
    5739AT_CHECK([file=test.xyz; diff $file ${abs_top_srcdir}/${AUTOTEST_PATH}/Simple_configuration/4/post/$file], 0, [ignore], [ignore])
    5840AT_CLEANUP
     
    6648AT_CHECK([file=test.in; diff $file ${abs_top_srcdir}/${AUTOTEST_PATH}/Simple_configuration/5/post/$file], 0, [ignore], [ignore])
    6749AT_CHECK([file=test.xyz; diff -I '.*Created by molecuilder.*' $file ${abs_top_srcdir}/${AUTOTEST_PATH}/Simple_configuration/5/post/$file], 0, [ignore], [ignore])
    68 AT_CLEANUP
    69 AT_SETUP([Simple configuration - Atom removal with Undo/Redo])
    70 AT_KEYWORDS([configuration])
    71 AT_CHECK([/bin/cp -f ${abs_top_srcdir}/${AUTOTEST_PATH}/Simple_configuration/5/pre/test.conf .], 0)
    72 AT_CHECK([../../molecuilder -i test.conf --select-atom-by-id 0 -r --undo], 0, [ignore], [ignore])
    73 AT_CHECK([file=test.conf; diff -I '.*Created by molecuilder.*' $file ${abs_top_srcdir}/${AUTOTEST_PATH}/Simple_configuration/5/pre/$file], 0, [ignore], [ignore])
    74 AT_CHECK([/bin/cp -f ${abs_top_srcdir}/${AUTOTEST_PATH}/Simple_configuration/5/pre/test.conf .], 0)
    75 AT_CHECK([../../molecuilder -i test.conf --select-atom-by-id 0 -r --undo --redo], 0, [ignore], [ignore])
    76 AT_CHECK([file=test.conf; diff -I '.*Created by molecuilder.*' $file ${abs_top_srcdir}/${AUTOTEST_PATH}/Simple_configuration/5/post/$file], 0, [ignore], [ignore])
    7750AT_CLEANUP
    7851
     
    11386AT_CHECK([file=test.xyz-sorted; diff $file ${abs_top_srcdir}/${AUTOTEST_PATH}/Simple_configuration/8/post/$file], 0, [ignore], [ignore])
    11487AT_CLEANUP
    115 AT_SETUP([Simple configuration - Removing sphere of atoms with Undo/Redo])
    116 AT_KEYWORDS([configuration])
    117 AT_CHECK([/bin/cp -f ${abs_top_srcdir}/${AUTOTEST_PATH}/Simple_configuration/8/pre/test.xyz .], 0)
    118 AT_CHECK([../../molecuilder -i test.xyz --select-atoms-inside-sphere 7. --position "7.283585982, 3.275186040, 3.535886037" -r --undo], 0, [stdout], [stderr])
    119 AT_CHECK([file=test.xyz; diff -I '.*Created by molecuilder.*' $file ${abs_top_srcdir}/${AUTOTEST_PATH}/Simple_configuration/8/pre/$file], 0, [ignore], [ignore])
    120 AT_CHECK([/bin/cp -f ${abs_top_srcdir}/${AUTOTEST_PATH}/Simple_configuration/8/pre/test.xyz test-withoutsphere.xyz], 0)
    121 AT_CHECK([../../molecuilder -i test-withoutsphere.xyz --select-atoms-inside-sphere 7. --position "7.283585982, 3.275186040, 3.535886037" -r --undo --redo], 0, [stdout], [stderr])
    122 AT_CHECK([sort -n test-withoutsphere.xyz | grep -v -E "^[[[:digit:]]]+" | grep -v "Created by" >test-withoutsphere.xyz-sorted], 0, [ignore], [ignore])
    123 AT_CHECK([file=test-withoutsphere.xyz-sorted; diff $file ${abs_top_srcdir}/${AUTOTEST_PATH}/Simple_configuration/8/post/$file], 0, [ignore], [ignore])
    124 AT_CHECK([/bin/cp -f ${abs_top_srcdir}/${AUTOTEST_PATH}/Simple_configuration/8/pre/test.xyz .], 0)
    125 AT_CHECK([../../molecuilder -i test.xyz --select-all-atoms --unselect-atoms-inside-sphere 7. --position "7.283585982, 3.275186040, 3.535886037" -r --undo], 0, [stdout], [stderr])
    126 AT_CHECK([file=test.xyz; diff -I '.*Created by molecuilder.*' $file ${abs_top_srcdir}/${AUTOTEST_PATH}/Simple_configuration/8/pre/$file], 0, [ignore], [ignore])
    127 AT_CHECK([/bin/cp -f ${abs_top_srcdir}/${AUTOTEST_PATH}/Simple_configuration/8/pre/test.xyz test-sphere.xyz], 0)
    128 AT_CHECK([../../molecuilder -i test-sphere.xyz --select-all-atoms --unselect-atoms-inside-sphere 7. --position "7.283585982, 3.275186040, 3.535886037" -r --undo --redo], 0, [stdout], [stderr])
    129 AT_CHECK([sort -n test-sphere.xyz | grep -v -E "^[[[:digit:]]]+" | grep -v "Created by" >test-sphere.xyz-sorted], 0, [ignore], [ignore])
    130 AT_CHECK([file=test-sphere.xyz-sorted; diff $file ${abs_top_srcdir}/${AUTOTEST_PATH}/Simple_configuration/8/post/$file], 0, [ignore], [ignore])
    131 AT_CHECK([cat test-sphere.xyz-sorted test-withoutsphere.xyz-sorted | sort -n >test.xyz-sorted], 0, [ignore], [ignore])
    132 AT_CHECK([file=test.xyz-sorted; diff $file ${abs_top_srcdir}/${AUTOTEST_PATH}/Simple_configuration/8/post/$file], 0, [ignore], [ignore])
    133 AT_CLEANUP
    13488
    13589AT_SETUP([Simple configuration - Removing cuboid of atoms])
     
    14195AT_CHECK([/bin/cp -f ${abs_top_srcdir}/${AUTOTEST_PATH}/Simple_configuration/8/pre/test.xyz test-cuboid.xyz], 0)
    14296AT_CHECK([../../molecuilder -i test-cuboid.xyz --select-all-atoms --unselect-atoms-inside-cuboid "2,2,2" --position "9.78,2.64,2.64" -r], 0, [stdout], [stderr])
    143 AT_CHECK([sort -n test-cuboid.xyz | grep -v -E "^[[[:digit:]]]+" | grep -v "Created by" >test-cuboid.xyz-sorted], 0, [ignore], [ignore])
    144 AT_CHECK([file=test-cuboid.xyz-sorted; diff $file ${abs_top_srcdir}/${AUTOTEST_PATH}/Simple_configuration/8/post/$file], 0, [ignore], [ignore])
    145 AT_CHECK([cat test-cuboid.xyz-sorted test-withoutcuboid.xyz-sorted | sort -n >test.xyz-sorted], 0, [ignore], [ignore])
    146 AT_CHECK([file=test.xyz-sorted; diff $file ${abs_top_srcdir}/${AUTOTEST_PATH}/Simple_configuration/8/post/$file], 0, [ignore], [ignore])
    147 AT_CLEANUP
    148 AT_SETUP([Simple configuration - Removing cuboid of atoms with Undo/Redo])
    149 AT_KEYWORDS([configuration])
    150 AT_CHECK([/bin/cp -f ${abs_top_srcdir}/${AUTOTEST_PATH}/Simple_configuration/8/pre/test.xyz .], 0)
    151 AT_CHECK([../../molecuilder -i test.xyz --select-atoms-inside-cuboid "2,2,2" --position "9.78,2.64,2.64" -r --undo], 0, [stdout], [stderr])
    152 AT_CHECK([file=test.xyz; diff -I '.*Created by molecuilder.*' $file ${abs_top_srcdir}/${AUTOTEST_PATH}/Simple_configuration/8/pre/$file], 0, [ignore], [ignore])
    153 AT_CHECK([/bin/cp -f ${abs_top_srcdir}/${AUTOTEST_PATH}/Simple_configuration/8/pre/test.xyz test-withoutcuboid.xyz], 0)
    154 AT_CHECK([../../molecuilder -i test-withoutcuboid.xyz --select-atoms-inside-cuboid "2,2,2" --position "9.78,2.64,2.64" -r --undo --redo], 0, [stdout], [stderr])
    155 AT_CHECK([sort -n test-withoutcuboid.xyz | grep -v -E "^[[[:digit:]]]+" | grep -v "Created by" >test-withoutcuboid.xyz-sorted], 0, [ignore], [ignore])
    156 AT_CHECK([file=test-withoutcuboid.xyz-sorted; diff $file ${abs_top_srcdir}/${AUTOTEST_PATH}/Simple_configuration/8/post/$file], 0, [ignore], [ignore])
    157 AT_CHECK([/bin/cp -f ${abs_top_srcdir}/${AUTOTEST_PATH}/Simple_configuration/8/pre/test.xyz .], 0)
    158 AT_CHECK([../../molecuilder -i test.xyz --select-all-atoms --unselect-atoms-inside-cuboid "2,2,2" --position "9.78,2.64,2.64" -r --undo], 0, [stdout], [stderr])
    159 AT_CHECK([file=test.xyz; diff -I '.*Created by molecuilder.*' $file ${abs_top_srcdir}/${AUTOTEST_PATH}/Simple_configuration/8/pre/$file], 0, [ignore], [ignore])
    160 AT_CHECK([/bin/cp -f ${abs_top_srcdir}/${AUTOTEST_PATH}/Simple_configuration/8/pre/test.xyz test-cuboid.xyz], 0)
    161 AT_CHECK([../../molecuilder -i test-cuboid.xyz --select-all-atoms --unselect-atoms-inside-cuboid "2,2,2" --position "9.78,2.64,2.64" -r --undo --redo], 0, [stdout], [stderr])
    16297AT_CHECK([sort -n test-cuboid.xyz | grep -v -E "^[[[:digit:]]]+" | grep -v "Created by" >test-cuboid.xyz-sorted], 0, [ignore], [ignore])
    16398AT_CHECK([file=test-cuboid.xyz-sorted; diff $file ${abs_top_srcdir}/${AUTOTEST_PATH}/Simple_configuration/8/post/$file], 0, [ignore], [ignore])
  • tests/regression/testsuite-standard_options.at

    r13e3c3 r6b5657  
    55AT_CHECK([pwd],[ignore],[ignore])
    66AT_CHECK([../../molecuilder -v 1], 0, [stdout], [ignore])
    7 AT_CHECK([grep "Setting verbosity from .* to 1" stdout], 0, [ignore], [ignore])
    8 AT_CLEANUP
    9 AT_SETUP([Standard Options - verbosity with Undo/Redo])
    10 AT_KEYWORDS([options])
    11 AT_CHECK([../../molecuilder -v 1 --undo], 0, [stdout], [ignore])
    12 AT_CHECK([grep "Setting verbosity from 1 to .*" stdout], 0, [ignore], [ignore])
    13 AT_CHECK([../../molecuilder -v 1 --undo --redo], 0, [stdout], [ignore])
    14 AT_CHECK([grep "Setting verbosity from .* to 1" stdout], 0, [ignore], [ignore])
     7AT_CHECK([fgrep olecuilder stdout], 0, [ignore], [ignore])
    158AT_CLEANUP
    169
     
    6053AT_CHECK([fgrep "I won't parse trajectories" stdout], 0, [ignore], [ignore])
    6154AT_CLEANUP
    62 AT_SETUP([Standard Options - fast trajectories with Undo/Redo])
    63 AT_KEYWORDS([options])
    64 AT_CHECK([../../molecuilder -i test.conf -n 1 --undo], 0, [stdout], [stderr])
    65 AT_CHECK([fgrep "I will parse trajectories." stdout], 0, [ignore], [ignore])
    66 AT_CHECK([../../molecuilder -i test.conf -n 1 --undo --redo], 0, [stdout], [stderr])
    67 AT_CHECK([grep -c "I won't parse trajectories" stdout], 0, 2
    68 , [ignore])
    69 AT_CLEANUP
    7055
    7156# 7. molecule default name
     
    7560AT_CHECK([fgrep "Default name of new molecules set to test." stdout], 0, [ignore], [ignore])
    7661AT_CLEANUP
    77 AT_SETUP([Standard Options - molecule default name with Undo/Redo])
    78 AT_KEYWORDS([options])
    79 AT_CHECK([../../molecuilder -i test.conf -X test --undo], 0, [stdout], [stderr])
    80 AT_CHECK([fgrep "Default name of new molecules set to none." stdout], 0, [ignore], [ignore])
    81 AT_CHECK([../../molecuilder -i test.conf -X test --undo --redo], 0, [stdout], [stderr])
    82 AT_CHECK([fgrep "Default name of new molecules set to test." stdout], 0, [ignore], [ignore])
    83 AT_CLEANUP
Note: See TracChangeset for help on using the changeset viewer.