Changes in / [13e3c3:6b5657]
- Files:
-
- 5 deleted
- 27 edited
-
src/Actions/AtomAction/AddAction.cpp (modified) (3 diffs)
-
src/Actions/AtomAction/ChangeElementAction.cpp (modified) (5 diffs)
-
src/Actions/AtomAction/RemoveAction.cpp (modified) (3 diffs)
-
src/Actions/CmdAction/FastParsingAction.cpp (modified) (3 diffs)
-
src/Actions/CmdAction/VerboseAction.cpp (modified) (3 diffs)
-
src/Actions/WorldAction/SetDefaultNameAction.cpp (modified) (2 diffs)
-
src/AtomicInfo.cpp (deleted)
-
src/AtomicInfo.hpp (deleted)
-
src/Helpers/Log.cpp (modified) (1 diff)
-
src/Helpers/Log.hpp (modified) (1 diff)
-
src/Helpers/errorlogger.cpp (modified) (1 diff)
-
src/Helpers/errorlogger.hpp (modified) (1 diff)
-
src/Helpers/logger.cpp (modified) (1 diff)
-
src/Helpers/logger.hpp (modified) (1 diff)
-
src/Makefile.am (modified) (2 diffs)
-
src/Shapes/BaseShapes.cpp (modified) (3 diffs)
-
src/Shapes/BaseShapes_impl.hpp (modified) (1 diff)
-
src/Shapes/Shape.cpp (modified) (5 diffs)
-
src/Shapes/Shape.hpp (modified) (2 diffs)
-
src/Shapes/ShapeOps.cpp (modified) (4 diffs)
-
src/Shapes/ShapeOps_impl.hpp (modified) (4 diffs)
-
src/Shapes/Shape_impl.hpp (modified) (7 diffs)
-
src/atom.cpp (modified) (1 diff)
-
src/atom.hpp (modified) (1 diff)
-
src/unittests/BaseShapesUnittest.cpp (deleted)
-
src/unittests/BaseShapesUnittest.hpp (deleted)
-
src/unittests/Makefile.am (modified) (4 diffs)
-
src/unittests/ShapeUnittest.cpp (modified) (3 diffs)
-
tests/regression/Simple_configuration/3/post/empty.conf (deleted)
-
tests/regression/Simple_configuration/5/pre/test.conf (modified) (4 diffs)
-
tests/regression/testsuite-simple_configuration.at (modified) (5 diffs)
-
tests/regression/testsuite-standard_options.at (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
src/Actions/AtomAction/AddAction.cpp
r13e3c3 r6b5657 15 15 #include "Actions/AtomAction/AddAction.hpp" 16 16 #include "Actions/ActionRegistry.hpp" 17 #include "Descriptors/AtomIdDescriptor.hpp"18 17 #include "atom.hpp" 19 18 #include "element.hpp" … … 32 31 #include "UIElements/Dialog.hpp" 33 32 #include "Actions/ValueStorage.hpp" 34 35 // memento to remember the state when undoing36 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 };48 33 49 34 const char AtomAddAction::NAME[] = "add-atom"; … … 90 75 (*iter)->AddAtom(first); 91 76 } 92 return Action::s tate_ptr(new AtomAddState(position, elemental, first->getId()));77 return Action::success; 93 78 } 94 79 95 80 Action::state_ptr AtomAddAction::performUndo(Action::state_ptr _state) { 96 AtomAddState *state = assert_cast<AtomAddState*>(_state.get());81 // ParserLoadXyzState *state = assert_cast<ParserLoadXyzState*>(_state.get()); 97 82 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)); 102 88 } 103 89 104 90 Action::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; 121 92 } 122 93 123 94 bool AtomAddAction::canUndo() { 124 return true;95 return false; 125 96 } 126 97 127 98 bool AtomAddAction::shouldUndo() { 128 return true;99 return false; 129 100 } 130 101 -
src/Actions/AtomAction/ChangeElementAction.cpp
r13e3c3 r6b5657 15 15 #include "Actions/AtomAction/ChangeElementAction.hpp" 16 16 #include "Actions/ActionRegistry.hpp" 17 #include "Descriptors/AtomIdDescriptor.hpp"18 17 #include "atom.hpp" 19 18 #include "element.hpp" … … 25 24 26 25 #include <iostream> 27 #include <map>28 26 #include <string> 29 27 … … 33 31 #include "UIElements/Dialog.hpp" 34 32 #include "Actions/ValueStorage.hpp" 35 36 typedef std::map<int, const element *> ElementMap;37 38 // memento to remember the state when undoing39 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 };49 33 50 34 const char AtomChangeElementAction::NAME[] = "change-element"; … … 77 61 ValueStorage::getInstance().queryCurrentValue(NAME, elemental); 78 62 79 // create undo state80 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 86 63 for (World::AtomSelectionIterator iter = World::getInstance().beginAtomSelection(); iter != World::getInstance().endAtomSelection(); ++iter) { 87 64 first = iter->second; … … 92 69 mol->AddAtom(first); // add atom to ensure correctness of formula 93 70 } 94 return Action::s tate_ptr(UndoState);71 return Action::success; 95 72 } 96 73 97 74 Action::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()); 101 76 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)); 111 82 } 112 83 113 84 Action::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; 127 86 } 128 87 129 88 bool AtomChangeElementAction::canUndo() { 130 return true;89 return false; 131 90 } 132 91 133 92 bool AtomChangeElementAction::shouldUndo() { 134 return true;93 return false; 135 94 } 136 95 -
src/Actions/AtomAction/RemoveAction.cpp
r13e3c3 r6b5657 16 16 #include "Actions/ActionRegistry.hpp" 17 17 #include "atom.hpp" 18 #include "AtomicInfo.hpp"19 18 #include "Descriptors/AtomDescriptor.hpp" 20 19 #include "Helpers/Log.hpp" … … 31 30 #include "UIElements/Dialog.hpp" 32 31 #include "Actions/ValueStorage.hpp" 33 34 // memento to remember the state when undoing35 36 class AtomRemoveState : public ActionState {37 public:38 AtomRemoveState(std::vector<AtomicInfo> _Walkers) :39 Walkers(_Walkers)40 {}41 std::vector<AtomicInfo> Walkers;42 };43 32 44 33 const char AtomRemoveAction::NAME[] = "remove-atom"; … … 66 55 atom *first = NULL; 67 56 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(); 77 58 for (World::AtomSelectionIterator iter = World::getInstance().beginAtomSelection(); iter != World::getInstance().endAtomSelection(); ++iter) { 78 59 first = iter->second; 79 60 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 World81 //// simply try to erase in every molecule found82 //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 } 85 66 World::getInstance().destroyAtom(first); 86 67 } 87 return Action::s tate_ptr(UndoState);68 return Action::success; 88 69 } 89 70 90 71 Action::state_ptr AtomRemoveAction::performUndo(Action::state_ptr _state) { 91 AtomRemoveState *state = assert_cast<AtomRemoveState*>(_state.get());72 // ParserLoadXyzState *state = assert_cast<ParserLoadXyzState*>(_state.get()); 92 73 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)); 112 79 } 113 80 114 81 Action::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; 124 83 } 125 84 126 85 bool AtomRemoveAction::canUndo() { 127 return true;86 return false; 128 87 } 129 88 130 89 bool AtomRemoveAction::shouldUndo() { 131 return true;90 return false; 132 91 } 133 92 -
src/Actions/CmdAction/FastParsingAction.cpp
r13e3c3 r6b5657 33 33 class CommandLineFastParsingState : public ActionState { 34 34 public: 35 CommandLineFastParsingState(const bool _oldvalue, const bool _newvalue) : 36 oldvalue(_oldvalue), 37 newvalue(_newvalue) 35 CommandLineFastParsingState(bool _bool) : 36 boolean(_bool) 38 37 {} 39 bool oldvalue; 40 bool newvalue; 38 bool boolean; 41 39 }; 42 40 … … 65 63 66 64 Action::state_ptr CommandLineFastParsingAction::performCall() { 65 67 66 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); 72 68 if (configuration->FastParsing) 73 69 DoLog(0) && (Log() << Verbose(0) << "I won't parse trajectories." << endl); 74 70 else 75 71 DoLog(0) && (Log() << Verbose(0) << "I will parse trajectories." << endl); 76 return Action::s tate_ptr(new CommandLineFastParsingState(oldvalue, newvalue));72 return Action::success; 77 73 } 78 74 … … 81 77 82 78 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; 88 80 89 return Action::state_ptr( _state);81 return Action::state_ptr(new CommandLineFastParsingState(!state->boolean)); 90 82 } 91 83 92 84 Action::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); 103 86 } 104 87 -
src/Actions/CmdAction/VerboseAction.cpp
r13e3c3 r6b5657 31 31 class CommandLineVerboseState : public ActionState { 32 32 public: 33 CommandLineVerboseState(const int _oldverbosity, const int _newverbosity) : 34 oldverbosity(_oldverbosity), 35 newverbosity(_newverbosity) 33 CommandLineVerboseState(int _verbosity) : 34 verbosity(_verbosity) 36 35 {} 37 int oldverbosity; 38 int newverbosity; 36 int verbosity; 39 37 }; 40 38 … … 63 61 64 62 Action::state_ptr CommandLineVerboseAction::performCall() { 65 int oldverbosity = getVerbosity(); 66 int newverbosity = 2; 63 int verbosity = 2; 67 64 68 ValueStorage::getInstance().queryCurrentValue(NAME, newverbosity);65 ValueStorage::getInstance().queryCurrentValue(NAME, verbosity); 69 66 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; 79 70 } 80 71 … … 82 73 CommandLineVerboseState *state = assert_cast<CommandLineVerboseState*>(_state.get()); 83 74 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); 86 77 87 return Action::state_ptr(_state); 78 setVerbosity(state->verbosity); 79 return Action::state_ptr(new CommandLineVerboseState(verbosity)); 88 80 } 89 81 90 82 Action::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); 97 84 } 98 85 -
src/Actions/WorldAction/SetDefaultNameAction.cpp
r13e3c3 r6b5657 67 67 68 68 defaultname = World::getInstance().getDefaultName(); 69 WorldSetDefaultNameState *UndoState = new WorldSetDefaultNameState(defaultname);70 69 ValueStorage::getInstance().queryCurrentValue(NAME, defaultname); 71 70 72 71 World::getInstance().setDefaultName(defaultname); 73 72 DoLog(0) && (Log() << Verbose(0) << "Default name of new molecules set to " << World::getInstance().getDefaultName() << "." << endl); 74 return Action::s tate_ptr(UndoState);73 return Action::success; 75 74 } 76 75 … … 80 79 string newName = World::getInstance().getDefaultName(); 81 80 World::getInstance().setDefaultName(state->lastName); 82 DoLog(0) && (Log() << Verbose(0) << "Default name of new molecules set to " << World::getInstance().getDefaultName() << "." << endl);83 81 84 82 return Action::state_ptr(new WorldSetDefaultNameState(newName)); -
src/Helpers/Log.cpp
r13e3c3 r6b5657 23 23 void setVerbosity(int verbosityLevel) { 24 24 logger::getInstance().setVerbosity(verbosityLevel); 25 }26 27 /**28 * Gets verbosity for the error logger and the standard logger.29 *30 * \param int verbosity level31 */32 int getVerbosity() {33 return logger::getInstance().getVerbosity();34 25 } 35 26 -
src/Helpers/Log.hpp
r13e3c3 r6b5657 15 15 class errorLogger & eLog(); 16 16 void setVerbosity(int verbosityLevel); 17 int getVerbosity();18 17 bool DoLog(int verbose); 19 18 bool DoeLog(int verbose); -
src/Helpers/errorlogger.cpp
r13e3c3 r6b5657 46 46 void errorLogger::setVerbosity(int verbosityLevel) { 47 47 verbosity = verbosityLevel; 48 }49 50 /**51 * Gets the verbosity.52 *53 * \return verbosity level54 */55 int errorLogger::getVerbosity()56 {57 return verbosity;58 48 } 59 49 -
src/Helpers/errorlogger.hpp
r13e3c3 r6b5657 25 25 static bool DoOutput(); 26 26 static void setVerbosity(int verbosityLevel); 27 static int getVerbosity();28 27 29 28 protected: -
src/Helpers/logger.cpp
r13e3c3 r6b5657 49 49 50 50 /** 51 * Gets the verbosity.52 *53 * \return verbosity level54 */55 int logger::getVerbosity()56 {57 return verbosity;58 }59 60 /**61 51 * Operator for the Binary(arg) call. 62 52 * Constructs temporary a Verbose class object, wherein the Binary is stored. -
src/Helpers/logger.hpp
r13e3c3 r6b5657 25 25 static bool DoOutput(); 26 26 static void setVerbosity(int verbosityLevel); 27 static int getVerbosity();28 27 29 28 protected: -
src/Makefile.am
r13e3c3 r6b5657 6 6 ATOMSOURCE = \ 7 7 atom.cpp \ 8 AtomicInfo.cpp \9 8 atom_atominfo.cpp \ 10 9 atom_bondedparticle.cpp \ … … 17 16 ATOMHEADER = \ 18 17 atom.hpp \ 19 AtomicInfo.hpp \20 18 atom_atominfo.hpp \ 21 19 atom_bondedparticle.hpp \ -
src/Shapes/BaseShapes.cpp
r13e3c3 r6b5657 16 16 #include "Shapes/BaseShapes_impl.hpp" 17 17 18 #include <cmath>19 20 #include "Helpers/Assert.hpp"21 18 #include "LinearAlgebra/Vector.hpp" 22 19 … … 24 21 return point.NormSquared()<=1; 25 22 } 26 27 28 /**29 * algorithm taken from http://www.cgafaq.info/wiki/Evenly_distributed_points_on_sphere30 * \param N number of points on surface31 */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 55 23 56 24 Shape Sphere(){ … … 60 28 61 29 bool 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; 72 31 } 73 32 74 33 Shape Cuboid(){ 75 Shape::impl_ptr impl = Shape::impl_ptr(new Cuboid_impl());34 Shape::impl_ptr impl = Shape::impl_ptr(new Sphere_impl()); 76 35 return Shape(impl); 77 36 } -
src/Shapes/BaseShapes_impl.hpp
r13e3c3 r6b5657 13 13 class Sphere_impl : public Shape_impl { 14 14 virtual bool isInside(const Vector &point); 15 virtual std::vector<Vector> getHomogeneousPointsOnSurface(const int N) const;16 15 }; 17 16 18 17 class Cuboid_impl : public Shape_impl { 19 18 virtual bool isInside(const Vector &point); 20 virtual std::vector<Vector> getHomogeneousPointsOnSurface(const int N) const;21 19 }; 22 20 -
src/Shapes/Shape.cpp
r13e3c3 r6b5657 16 16 #include "Shape_impl.hpp" 17 17 18 19 #include "Helpers/Assert.hpp"20 #include "LinearAlgebra/Vector.hpp"21 22 18 Shape::Shape(const Shape& src) : 23 19 impl(src.getImpl()) … … 28 24 bool Shape::isInside(const Vector &point) const{ 29 25 return impl->isInside(point); 30 }31 32 std::vector<Vector> Shape::getHomogeneousPointsOnSurface(const int N) const {33 return impl->getHomogeneousPointsOnSurface(N);34 26 } 35 27 … … 80 72 } 81 73 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 100 74 Shape operator&&(const Shape &lhs,const Shape &rhs){ 101 75 Shape::impl_ptr newImpl = Shape::impl_ptr(new AndShape_impl(getShapeImpl(lhs),getShapeImpl(rhs))); … … 113 87 bool OrShape_impl::isInside(const Vector &point){ 114 88 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;132 89 } 133 90 … … 149 106 } 150 107 151 std::vector<Vector> NotShape_impl::getHomogeneousPointsOnSurface(const int N) const {152 // surfaces are the same, only normal direction is different153 return arg->getHomogeneousPointsOnSurface(N);154 }155 156 108 Shape operator!(const Shape &arg){ 157 109 Shape::impl_ptr newImpl = Shape::impl_ptr(new NotShape_impl(getShapeImpl(arg))); -
src/Shapes/Shape.hpp
r13e3c3 r6b5657 10 10 11 11 #include <boost/shared_ptr.hpp> 12 13 #include <vector>14 12 15 13 class Vector; … … 27 25 28 26 bool isInside(const Vector &point) const; 29 std::vector<Vector> getHomogeneousPointsOnSurface(const int N) const;30 27 31 28 Shape &operator=(const Shape& rhs); -
src/Shapes/ShapeOps.cpp
r13e3c3 r6b5657 32 32 } 33 33 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 43 34 Shape resize(const Shape &arg,double size){ 44 35 Shape::impl_ptr impl = Shape::impl_ptr(new Resize_impl(getShapeImpl(arg),size)); … … 56 47 bool Translate_impl::isInside(const Vector& point){ 57 48 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;66 49 } 67 50 … … 92 75 } 93 76 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 102 77 Shape stretch(const Shape &arg, const Vector &factors){ 103 78 Shape::impl_ptr impl = Shape::impl_ptr(new Stretch_impl(getShapeImpl(arg),factors)); … … 119 94 } 120 95 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 129 96 Shape transform(const Shape &arg, const Matrix &transformation){ 130 97 Shape::impl_ptr impl = Shape::impl_ptr(new Transform_impl(getShapeImpl(arg),transformation)); -
src/Shapes/ShapeOps_impl.hpp
r13e3c3 r6b5657 19 19 virtual ~Resize_impl(); 20 20 virtual bool isInside(const Vector& point); 21 virtual std::vector<Vector> getHomogeneousPointsOnSurface(const int N) const;22 21 private: 23 22 Shape::impl_ptr arg; … … 31 30 virtual ~Translate_impl(); 32 31 virtual bool isInside(const Vector& point); 33 virtual std::vector<Vector> getHomogeneousPointsOnSurface(const int N) const;34 32 private: 35 33 Shape::impl_ptr arg; … … 43 41 virtual ~Stretch_impl(); 44 42 virtual bool isInside(const Vector& point); 45 virtual std::vector<Vector> getHomogeneousPointsOnSurface(const int N) const;46 43 private: 47 44 Shape::impl_ptr arg; … … 56 53 virtual ~Transform_impl(); 57 54 virtual bool isInside(const Vector& point); 58 virtual std::vector<Vector> getHomogeneousPointsOnSurface(const int N) const;59 55 private: 60 56 Shape::impl_ptr arg; -
src/Shapes/Shape_impl.hpp
r13e3c3 r6b5657 9 9 #define SHAPE_IMPL_HPP_ 10 10 11 #include <vector>12 13 11 #include "Shapes/Shape.hpp" 14 15 class Vector;16 12 17 13 class Shape_impl { … … 20 16 virtual ~Shape_impl(){}; 21 17 virtual bool isInside(const Vector &point)=0; 22 virtual std::vector<Vector> getHomogeneousPointsOnSurface(const int N) const=0;23 18 }; 24 19 … … 28 23 return true; 29 24 } 30 virtual std::vector<Vector> getHomogeneousPointsOnSurface(const int N) const {31 std::vector<Vector> PointsOnSurface;32 return PointsOnSurface;33 }34 25 }; 35 26 … … 37 28 virtual bool isInside(const Vector &point){ 38 29 return false; 39 }40 virtual std::vector<Vector> getHomogeneousPointsOnSurface(const int N) const {41 std::vector<Vector> PointsOnSurface;42 return PointsOnSurface;43 30 } 44 31 }; … … 49 36 virtual ~AndShape_impl(); 50 37 virtual bool isInside(const Vector &point); 51 virtual std::vector<Vector> getHomogeneousPointsOnSurface(const int N) const;52 38 private: 53 39 Shape::impl_ptr lhs; … … 60 46 virtual ~OrShape_impl(); 61 47 virtual bool isInside(const Vector &point); 62 virtual std::vector<Vector> getHomogeneousPointsOnSurface(const int N) const;63 48 private: 64 49 Shape::impl_ptr lhs; … … 71 56 virtual ~NotShape_impl(); 72 57 virtual bool isInside(const Vector &point); 73 virtual std::vector<Vector> getHomogeneousPointsOnSurface(const int N) const;74 58 private: 75 59 Shape::impl_ptr arg; -
src/atom.cpp
r13e3c3 r6b5657 358 358 } 359 359 360 molecule* atom::getMolecule() const{360 molecule* atom::getMolecule(){ 361 361 return mol; 362 362 } -
src/atom.hpp
r13e3c3 r6b5657 92 92 93 93 void setMolecule(molecule*); 94 molecule* getMolecule() const;94 molecule* getMolecule(); 95 95 void removeFromMolecule(); 96 96 -
src/unittests/Makefile.am
r13e3c3 r6b5657 16 16 atomsCalculationTest \ 17 17 AtomDescriptorTest \ 18 BaseShapesUnitTest \19 18 BondGraphUnitTest \ 20 19 BoxUnittest \ … … 74 73 AtomDescriptorTest.cpp \ 75 74 atomsCalculationTest.cpp \ 76 BaseShapesUnittest.cpp \77 75 bondgraphunittest.cpp \ 78 76 BoxUnittest.cpp \ … … 113 111 AtomDescriptorTest.hpp \ 114 112 atomsCalculationTest.hpp \ 115 BaseShapesUnittest.hpp \116 113 bondgraphunittest.hpp \ 117 114 BoxUnittest.hpp \ … … 167 164 AtomDescriptorTest_LDADD = ${ALLLIBS} 168 165 169 BaseShapesUnitTest_SOURCES = UnitTestMain.cpp BaseShapesUnittest.cpp BaseShapesUnittest.hpp170 BaseShapesUnitTest_LDADD = ${ALLLIBS}171 172 166 BondGraphUnitTest_SOURCES = UnitTestMain.cpp bondgraphunittest.cpp bondgraphunittest.hpp 173 167 BondGraphUnitTest_LDADD = ${ALLLIBS} -
src/unittests/ShapeUnittest.cpp
r13e3c3 r6b5657 17 17 #include <cppunit/ui/text/TestRunner.h> 18 18 19 #include <cmath>20 21 19 #ifdef HAVE_TESTRUNNER 22 20 #include "UnitTestMain.hpp" … … 25 23 #include "LinearAlgebra/Vector.hpp" 26 24 #include "Shapes/Shape.hpp" 27 28 #include "Shapes/BaseShapes.hpp"29 25 30 26 // Registers the fixture into the 'registry' … … 188 184 189 185 } 190 191 186 void ShapeUnittest::operatorTest(){ 192 187 { -
tests/regression/Simple_configuration/5/pre/test.conf
r13e3c3 r6b5657 28 28 OutSrcStep 5 # Output "restart" data every ..th step 29 29 TargetTemp 0.000950045 # Target temperature 30 MaxPsiStep 3# number of Minimisation steps per state (0 - default)30 MaxPsiStep 0 # number of Minimisation steps per state (0 - default) 31 31 EpsWannier 1e-07 # tolerance value for spread minimisation of orbitals 32 32 … … 35 35 RelEpsTotalE 1e-07 # relative change in total energy 36 36 RelEpsKineticE 1e-05 # relative change in kinetic energy 37 MaxMinStopStep 1# check every ..th steps38 MaxMinGapStopStep 1# check every ..th steps37 MaxMinStopStep 0 # check every ..th steps 38 MaxMinGapStopStep 0 # check every ..th steps 39 39 40 40 # Values specifying when to stop for INIT, otherwise same as above … … 42 42 InitRelEpsTotalE 1e-05 # relative change in total energy 43 43 InitRelEpsKineticE 0.0001 # relative change in kinetic energy 44 InitMaxMinStopStep 1# check every ..th steps45 InitMaxMinGapStopStep 1# check every ..th steps44 InitMaxMinStopStep 0 # check every ..th steps 45 InitMaxMinGapStopStep 0 # check every ..th steps 46 46 47 47 BoxLength # (Length of a unit cell) … … 54 54 Level0Factor 2 # factor by which node number increases from S to 0 level 55 55 RiemannTensor 0 # (Use metric) 56 PsiType 1# 0 - doubly occupied, 1 - SpinUp,SpinDown56 PsiType 0 # 0 - doubly occupied, 1 - SpinUp,SpinDown 57 57 MaxPsiDouble 0 # here: specifying both maximum number of SpinUp- and -Down-states 58 58 PsiMaxNoUp 0 # here: specifying maximum number of SpinUp-states 59 PsiMaxNoDown 1# here: specifying maximum number of SpinDown-states59 PsiMaxNoDown 0 # here: specifying maximum number of SpinDown-states 60 60 AddPsis 0 # Additional unoccupied Psis for bandgap determination 61 61 -
tests/regression/testsuite-simple_configuration.at
r13e3c3 r6b5657 31 31 AT_CHECK([../../molecuilder -i test2.conf -e ${abs_top_srcdir}/src/ -o mpqc pcp xyz -a 1 --position "0., 0., -1."], 134, [ignore], [ignore]) 32 32 AT_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_CLEANUP42 33 43 34 # 4. change the element … … 46 37 AT_CHECK([/bin/cp -f ${abs_top_srcdir}/${AUTOTEST_PATH}/Simple_configuration/4/pre/test.xyz test.xyz], 0) 47 38 AT_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_CLEANUP50 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])57 39 AT_CHECK([file=test.xyz; diff $file ${abs_top_srcdir}/${AUTOTEST_PATH}/Simple_configuration/4/post/$file], 0, [ignore], [ignore]) 58 40 AT_CLEANUP … … 66 48 AT_CHECK([file=test.in; diff $file ${abs_top_srcdir}/${AUTOTEST_PATH}/Simple_configuration/5/post/$file], 0, [ignore], [ignore]) 67 49 AT_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_CLEANUP69 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])77 50 AT_CLEANUP 78 51 … … 113 86 AT_CHECK([file=test.xyz-sorted; diff $file ${abs_top_srcdir}/${AUTOTEST_PATH}/Simple_configuration/8/post/$file], 0, [ignore], [ignore]) 114 87 AT_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_CLEANUP134 88 135 89 AT_SETUP([Simple configuration - Removing cuboid of atoms]) … … 141 95 AT_CHECK([/bin/cp -f ${abs_top_srcdir}/${AUTOTEST_PATH}/Simple_configuration/8/pre/test.xyz test-cuboid.xyz], 0) 142 96 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], 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_CLEANUP148 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])162 97 AT_CHECK([sort -n test-cuboid.xyz | grep -v -E "^[[[:digit:]]]+" | grep -v "Created by" >test-cuboid.xyz-sorted], 0, [ignore], [ignore]) 163 98 AT_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 5 5 AT_CHECK([pwd],[ignore],[ignore]) 6 6 AT_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]) 7 AT_CHECK([fgrep olecuilder stdout], 0, [ignore], [ignore]) 15 8 AT_CLEANUP 16 9 … … 60 53 AT_CHECK([fgrep "I won't parse trajectories" stdout], 0, [ignore], [ignore]) 61 54 AT_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, 268 , [ignore])69 AT_CLEANUP70 55 71 56 # 7. molecule default name … … 75 60 AT_CHECK([fgrep "Default name of new molecules set to test." stdout], 0, [ignore], [ignore]) 76 61 AT_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.
