Changes in / [6b5657:13e3c3]
- Files:
-
- 5 added
- 27 edited
Legend:
- Unmodified
- Added
- Removed
-
src/Actions/AtomAction/AddAction.cpp
r6b5657 r13e3c3 15 15 #include "Actions/AtomAction/AddAction.hpp" 16 16 #include "Actions/ActionRegistry.hpp" 17 #include "Descriptors/AtomIdDescriptor.hpp" 17 18 #include "atom.hpp" 18 19 #include "element.hpp" … … 31 32 #include "UIElements/Dialog.hpp" 32 33 #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 }; 33 48 34 49 const char AtomAddAction::NAME[] = "add-atom"; … … 75 90 (*iter)->AddAtom(first); 76 91 } 77 return Action::s uccess;92 return Action::state_ptr(new AtomAddState(position, elemental, first->getId())); 78 93 } 79 94 80 95 Action::state_ptr AtomAddAction::performUndo(Action::state_ptr _state) { 81 // ParserLoadXyzState *state = assert_cast<ParserLoadXyzState*>(_state.get());96 AtomAddState *state = assert_cast<AtomAddState*>(_state.get()); 82 97 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)); 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); 88 102 } 89 103 90 104 Action::state_ptr AtomAddAction::performRedo(Action::state_ptr _state){ 91 return Action::failure; 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); 92 121 } 93 122 94 123 bool AtomAddAction::canUndo() { 95 return false;124 return true; 96 125 } 97 126 98 127 bool AtomAddAction::shouldUndo() { 99 return false;128 return true; 100 129 } 101 130 -
src/Actions/AtomAction/ChangeElementAction.cpp
r6b5657 r13e3c3 15 15 #include "Actions/AtomAction/ChangeElementAction.hpp" 16 16 #include "Actions/ActionRegistry.hpp" 17 #include "Descriptors/AtomIdDescriptor.hpp" 17 18 #include "atom.hpp" 18 19 #include "element.hpp" … … 24 25 25 26 #include <iostream> 27 #include <map> 26 28 #include <string> 27 29 … … 31 33 #include "UIElements/Dialog.hpp" 32 34 #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 }; 33 49 34 50 const char AtomChangeElementAction::NAME[] = "change-element"; … … 61 77 ValueStorage::getInstance().queryCurrentValue(NAME, elemental); 62 78 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 63 86 for (World::AtomSelectionIterator iter = World::getInstance().beginAtomSelection(); iter != World::getInstance().endAtomSelection(); ++iter) { 64 87 first = iter->second; … … 69 92 mol->AddAtom(first); // add atom to ensure correctness of formula 70 93 } 71 return Action::s uccess;94 return Action::state_ptr(UndoState); 72 95 } 73 96 74 97 Action::state_ptr AtomChangeElementAction::performUndo(Action::state_ptr _state) { 75 // ParserLoadXyzState *state = assert_cast<ParserLoadXyzState*>(_state.get()); 98 AtomChangeElementState *state = assert_cast<AtomChangeElementState*>(_state.get()); 99 atom *first = NULL; 100 molecule *mol = NULL; 76 101 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)); 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); 82 111 } 83 112 84 113 Action::state_ptr AtomChangeElementAction::performRedo(Action::state_ptr _state){ 85 return Action::failure; 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); 86 127 } 87 128 88 129 bool AtomChangeElementAction::canUndo() { 89 return false;130 return true; 90 131 } 91 132 92 133 bool AtomChangeElementAction::shouldUndo() { 93 return false;134 return true; 94 135 } 95 136 -
src/Actions/AtomAction/RemoveAction.cpp
r6b5657 r13e3c3 16 16 #include "Actions/ActionRegistry.hpp" 17 17 #include "atom.hpp" 18 #include "AtomicInfo.hpp" 18 19 #include "Descriptors/AtomDescriptor.hpp" 19 20 #include "Helpers/Log.hpp" … … 30 31 #include "UIElements/Dialog.hpp" 31 32 #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 }; 32 43 33 44 const char AtomRemoveAction::NAME[] = "remove-atom"; … … 55 66 atom *first = NULL; 56 67 57 std::vector<molecule *> molecules = World::getInstance().getAllMolecules(); 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(); 58 77 for (World::AtomSelectionIterator iter = World::getInstance().beginAtomSelection(); iter != World::getInstance().endAtomSelection(); ++iter) { 59 78 first = iter->second; 60 79 DoLog(1) && (Log() << Verbose(1) << "Removing atom " << first->getId() << "." << endl); 61 // TODO: this is not necessary when atoms and their storing to file are handled by the World62 // simply try to erase in every molecule found63 for (std::vector<molecule *>::iterator iter = molecules.begin();iter != molecules.end(); ++iter) {64 (*iter)->erase(first);65 }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 // } 66 85 World::getInstance().destroyAtom(first); 67 86 } 68 return Action::s uccess;87 return Action::state_ptr(UndoState); 69 88 } 70 89 71 90 Action::state_ptr AtomRemoveAction::performUndo(Action::state_ptr _state) { 72 // ParserLoadXyzState *state = assert_cast<ParserLoadXyzState*>(_state.get());91 AtomRemoveState *state = assert_cast<AtomRemoveState*>(_state.get()); 73 92 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)); 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); 79 112 } 80 113 81 114 Action::state_ptr AtomRemoveAction::performRedo(Action::state_ptr _state){ 82 return Action::failure; 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); 83 124 } 84 125 85 126 bool AtomRemoveAction::canUndo() { 86 return false;127 return true; 87 128 } 88 129 89 130 bool AtomRemoveAction::shouldUndo() { 90 return false;131 return true; 91 132 } 92 133 -
src/Actions/CmdAction/FastParsingAction.cpp
r6b5657 r13e3c3 33 33 class CommandLineFastParsingState : public ActionState { 34 34 public: 35 CommandLineFastParsingState(bool _bool) : 36 boolean(_bool) 35 CommandLineFastParsingState(const bool _oldvalue, const bool _newvalue) : 36 oldvalue(_oldvalue), 37 newvalue(_newvalue) 37 38 {} 38 bool boolean; 39 bool oldvalue; 40 bool newvalue; 39 41 }; 40 42 … … 63 65 64 66 Action::state_ptr CommandLineFastParsingAction::performCall() { 65 66 67 config *configuration = World::getInstance().getConfig(); 67 ValueStorage::getInstance().queryCurrentValue(NAME, configuration->FastParsing); 68 bool oldvalue = configuration->FastParsing; 69 bool newvalue; 70 ValueStorage::getInstance().queryCurrentValue(NAME, newvalue); 71 configuration->FastParsing = newvalue; 68 72 if (configuration->FastParsing) 69 73 DoLog(0) && (Log() << Verbose(0) << "I won't parse trajectories." << endl); 70 74 else 71 75 DoLog(0) && (Log() << Verbose(0) << "I will parse trajectories." << endl); 72 return Action::s uccess;76 return Action::state_ptr(new CommandLineFastParsingState(oldvalue, newvalue)); 73 77 } 74 78 … … 77 81 78 82 config *configuration = World::getInstance().getConfig(); 79 configuration->FastParsing = state->boolean; 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); 80 88 81 return Action::state_ptr( new CommandLineFastParsingState(!state->boolean));89 return Action::state_ptr(_state); 82 90 } 83 91 84 92 Action::state_ptr CommandLineFastParsingAction::performRedo(Action::state_ptr _state){ 85 return performUndo(_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); 86 103 } 87 104 -
src/Actions/CmdAction/VerboseAction.cpp
r6b5657 r13e3c3 31 31 class CommandLineVerboseState : public ActionState { 32 32 public: 33 CommandLineVerboseState(int _verbosity) : 34 verbosity(_verbosity) 33 CommandLineVerboseState(const int _oldverbosity, const int _newverbosity) : 34 oldverbosity(_oldverbosity), 35 newverbosity(_newverbosity) 35 36 {} 36 int verbosity; 37 int oldverbosity; 38 int newverbosity; 37 39 }; 38 40 … … 61 63 62 64 Action::state_ptr CommandLineVerboseAction::performCall() { 63 int verbosity = 2; 65 int oldverbosity = getVerbosity(); 66 int newverbosity = 2; 64 67 65 ValueStorage::getInstance().queryCurrentValue(NAME, verbosity);68 ValueStorage::getInstance().queryCurrentValue(NAME, newverbosity); 66 69 67 setVerbosity(verbosity); 68 DoLog(0) && (Log() << Verbose(0) << "Setting verbosity to " << verbosity << "." << endl); 69 return Action::success; 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 } 70 79 } 71 80 … … 73 82 CommandLineVerboseState *state = assert_cast<CommandLineVerboseState*>(_state.get()); 74 83 75 int verbosity = 2;76 ValueStorage::getInstance().queryCurrentValue(NAME,verbosity);84 DoLog(0) && (Log() << Verbose(0) << "Setting verbosity from " << state->newverbosity << " to " << state->oldverbosity << "." << endl); 85 setVerbosity(state->oldverbosity); 77 86 78 setVerbosity(state->verbosity); 79 return Action::state_ptr(new CommandLineVerboseState(verbosity)); 87 return Action::state_ptr(_state); 80 88 } 81 89 82 90 Action::state_ptr CommandLineVerboseAction::performRedo(Action::state_ptr _state){ 83 return performUndo(_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); 84 97 } 85 98 -
src/Actions/WorldAction/SetDefaultNameAction.cpp
r6b5657 r13e3c3 67 67 68 68 defaultname = World::getInstance().getDefaultName(); 69 WorldSetDefaultNameState *UndoState = new WorldSetDefaultNameState(defaultname); 69 70 ValueStorage::getInstance().queryCurrentValue(NAME, defaultname); 70 71 71 72 World::getInstance().setDefaultName(defaultname); 72 73 DoLog(0) && (Log() << Verbose(0) << "Default name of new molecules set to " << World::getInstance().getDefaultName() << "." << endl); 73 return Action::s uccess;74 return Action::state_ptr(UndoState); 74 75 } 75 76 … … 79 80 string newName = World::getInstance().getDefaultName(); 80 81 World::getInstance().setDefaultName(state->lastName); 82 DoLog(0) && (Log() << Verbose(0) << "Default name of new molecules set to " << World::getInstance().getDefaultName() << "." << endl); 81 83 82 84 return Action::state_ptr(new WorldSetDefaultNameState(newName)); -
src/Helpers/Log.cpp
r6b5657 r13e3c3 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 level 31 */ 32 int getVerbosity() { 33 return logger::getInstance().getVerbosity(); 25 34 } 26 35 -
src/Helpers/Log.hpp
r6b5657 r13e3c3 15 15 class errorLogger & eLog(); 16 16 void setVerbosity(int verbosityLevel); 17 int getVerbosity(); 17 18 bool DoLog(int verbose); 18 19 bool DoeLog(int verbose); -
src/Helpers/errorlogger.cpp
r6b5657 r13e3c3 46 46 void errorLogger::setVerbosity(int verbosityLevel) { 47 47 verbosity = verbosityLevel; 48 } 49 50 /** 51 * Gets the verbosity. 52 * 53 * \return verbosity level 54 */ 55 int errorLogger::getVerbosity() 56 { 57 return verbosity; 48 58 } 49 59 -
src/Helpers/errorlogger.hpp
r6b5657 r13e3c3 25 25 static bool DoOutput(); 26 26 static void setVerbosity(int verbosityLevel); 27 static int getVerbosity(); 27 28 28 29 protected: -
src/Helpers/logger.cpp
r6b5657 r13e3c3 49 49 50 50 /** 51 * Gets the verbosity. 52 * 53 * \return verbosity level 54 */ 55 int logger::getVerbosity() 56 { 57 return verbosity; 58 } 59 60 /** 51 61 * Operator for the Binary(arg) call. 52 62 * Constructs temporary a Verbose class object, wherein the Binary is stored. -
src/Helpers/logger.hpp
r6b5657 r13e3c3 25 25 static bool DoOutput(); 26 26 static void setVerbosity(int verbosityLevel); 27 static int getVerbosity(); 27 28 28 29 protected: -
src/Makefile.am
r6b5657 r13e3c3 6 6 ATOMSOURCE = \ 7 7 atom.cpp \ 8 AtomicInfo.cpp \ 8 9 atom_atominfo.cpp \ 9 10 atom_bondedparticle.cpp \ … … 16 17 ATOMHEADER = \ 17 18 atom.hpp \ 19 AtomicInfo.hpp \ 18 20 atom_atominfo.hpp \ 19 21 atom_bondedparticle.hpp \ -
src/Shapes/BaseShapes.cpp
r6b5657 r13e3c3 16 16 #include "Shapes/BaseShapes_impl.hpp" 17 17 18 #include <cmath> 19 20 #include "Helpers/Assert.hpp" 18 21 #include "LinearAlgebra/Vector.hpp" 19 22 … … 21 24 return point.NormSquared()<=1; 22 25 } 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 23 55 24 56 Shape Sphere(){ … … 28 60 29 61 bool Cuboid_impl::isInside(const Vector &point){ 30 return point[0]<=1 && point[1]<=1 && point[2]<=1; 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; 31 72 } 32 73 33 74 Shape Cuboid(){ 34 Shape::impl_ptr impl = Shape::impl_ptr(new Sphere_impl());75 Shape::impl_ptr impl = Shape::impl_ptr(new Cuboid_impl()); 35 76 return Shape(impl); 36 77 } -
src/Shapes/BaseShapes_impl.hpp
r6b5657 r13e3c3 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; 15 16 }; 16 17 17 18 class Cuboid_impl : public Shape_impl { 18 19 virtual bool isInside(const Vector &point); 20 virtual std::vector<Vector> getHomogeneousPointsOnSurface(const int N) const; 19 21 }; 20 22 -
src/Shapes/Shape.cpp
r6b5657 r13e3c3 16 16 #include "Shape_impl.hpp" 17 17 18 19 #include "Helpers/Assert.hpp" 20 #include "LinearAlgebra/Vector.hpp" 21 18 22 Shape::Shape(const Shape& src) : 19 23 impl(src.getImpl()) … … 24 28 bool Shape::isInside(const Vector &point) const{ 25 29 return impl->isInside(point); 30 } 31 32 std::vector<Vector> Shape::getHomogeneousPointsOnSurface(const int N) const { 33 return impl->getHomogeneousPointsOnSurface(N); 26 34 } 27 35 … … 72 80 } 73 81 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 74 100 Shape operator&&(const Shape &lhs,const Shape &rhs){ 75 101 Shape::impl_ptr newImpl = Shape::impl_ptr(new AndShape_impl(getShapeImpl(lhs),getShapeImpl(rhs))); … … 87 113 bool OrShape_impl::isInside(const Vector &point){ 88 114 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; 89 132 } 90 133 … … 106 149 } 107 150 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 108 156 Shape operator!(const Shape &arg){ 109 157 Shape::impl_ptr newImpl = Shape::impl_ptr(new NotShape_impl(getShapeImpl(arg))); -
src/Shapes/Shape.hpp
r6b5657 r13e3c3 10 10 11 11 #include <boost/shared_ptr.hpp> 12 13 #include <vector> 12 14 13 15 class Vector; … … 25 27 26 28 bool isInside(const Vector &point) const; 29 std::vector<Vector> getHomogeneousPointsOnSurface(const int N) const; 27 30 28 31 Shape &operator=(const Shape& rhs); -
src/Shapes/ShapeOps.cpp
r6b5657 r13e3c3 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 34 43 Shape resize(const Shape &arg,double size){ 35 44 Shape::impl_ptr impl = Shape::impl_ptr(new Resize_impl(getShapeImpl(arg),size)); … … 47 56 bool Translate_impl::isInside(const Vector& point){ 48 57 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; 49 66 } 50 67 … … 75 92 } 76 93 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 77 102 Shape stretch(const Shape &arg, const Vector &factors){ 78 103 Shape::impl_ptr impl = Shape::impl_ptr(new Stretch_impl(getShapeImpl(arg),factors)); … … 94 119 } 95 120 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 96 129 Shape transform(const Shape &arg, const Matrix &transformation){ 97 130 Shape::impl_ptr impl = Shape::impl_ptr(new Transform_impl(getShapeImpl(arg),transformation)); -
src/Shapes/ShapeOps_impl.hpp
r6b5657 r13e3c3 19 19 virtual ~Resize_impl(); 20 20 virtual bool isInside(const Vector& point); 21 virtual std::vector<Vector> getHomogeneousPointsOnSurface(const int N) const; 21 22 private: 22 23 Shape::impl_ptr arg; … … 30 31 virtual ~Translate_impl(); 31 32 virtual bool isInside(const Vector& point); 33 virtual std::vector<Vector> getHomogeneousPointsOnSurface(const int N) const; 32 34 private: 33 35 Shape::impl_ptr arg; … … 41 43 virtual ~Stretch_impl(); 42 44 virtual bool isInside(const Vector& point); 45 virtual std::vector<Vector> getHomogeneousPointsOnSurface(const int N) const; 43 46 private: 44 47 Shape::impl_ptr arg; … … 53 56 virtual ~Transform_impl(); 54 57 virtual bool isInside(const Vector& point); 58 virtual std::vector<Vector> getHomogeneousPointsOnSurface(const int N) const; 55 59 private: 56 60 Shape::impl_ptr arg; -
src/Shapes/Shape_impl.hpp
r6b5657 r13e3c3 9 9 #define SHAPE_IMPL_HPP_ 10 10 11 #include <vector> 12 11 13 #include "Shapes/Shape.hpp" 14 15 class Vector; 12 16 13 17 class Shape_impl { … … 16 20 virtual ~Shape_impl(){}; 17 21 virtual bool isInside(const Vector &point)=0; 22 virtual std::vector<Vector> getHomogeneousPointsOnSurface(const int N) const=0; 18 23 }; 19 24 … … 23 28 return true; 24 29 } 30 virtual std::vector<Vector> getHomogeneousPointsOnSurface(const int N) const { 31 std::vector<Vector> PointsOnSurface; 32 return PointsOnSurface; 33 } 25 34 }; 26 35 … … 28 37 virtual bool isInside(const Vector &point){ 29 38 return false; 39 } 40 virtual std::vector<Vector> getHomogeneousPointsOnSurface(const int N) const { 41 std::vector<Vector> PointsOnSurface; 42 return PointsOnSurface; 30 43 } 31 44 }; … … 36 49 virtual ~AndShape_impl(); 37 50 virtual bool isInside(const Vector &point); 51 virtual std::vector<Vector> getHomogeneousPointsOnSurface(const int N) const; 38 52 private: 39 53 Shape::impl_ptr lhs; … … 46 60 virtual ~OrShape_impl(); 47 61 virtual bool isInside(const Vector &point); 62 virtual std::vector<Vector> getHomogeneousPointsOnSurface(const int N) const; 48 63 private: 49 64 Shape::impl_ptr lhs; … … 56 71 virtual ~NotShape_impl(); 57 72 virtual bool isInside(const Vector &point); 73 virtual std::vector<Vector> getHomogeneousPointsOnSurface(const int N) const; 58 74 private: 59 75 Shape::impl_ptr arg; -
src/atom.cpp
r6b5657 r13e3c3 358 358 } 359 359 360 molecule* atom::getMolecule() {360 molecule* atom::getMolecule() const { 361 361 return mol; 362 362 } -
src/atom.hpp
r6b5657 r13e3c3 92 92 93 93 void setMolecule(molecule*); 94 molecule* getMolecule() ;94 molecule* getMolecule() const; 95 95 void removeFromMolecule(); 96 96 -
src/unittests/Makefile.am
r6b5657 r13e3c3 16 16 atomsCalculationTest \ 17 17 AtomDescriptorTest \ 18 BaseShapesUnitTest \ 18 19 BondGraphUnitTest \ 19 20 BoxUnittest \ … … 73 74 AtomDescriptorTest.cpp \ 74 75 atomsCalculationTest.cpp \ 76 BaseShapesUnittest.cpp \ 75 77 bondgraphunittest.cpp \ 76 78 BoxUnittest.cpp \ … … 111 113 AtomDescriptorTest.hpp \ 112 114 atomsCalculationTest.hpp \ 115 BaseShapesUnittest.hpp \ 113 116 bondgraphunittest.hpp \ 114 117 BoxUnittest.hpp \ … … 164 167 AtomDescriptorTest_LDADD = ${ALLLIBS} 165 168 169 BaseShapesUnitTest_SOURCES = UnitTestMain.cpp BaseShapesUnittest.cpp BaseShapesUnittest.hpp 170 BaseShapesUnitTest_LDADD = ${ALLLIBS} 171 166 172 BondGraphUnitTest_SOURCES = UnitTestMain.cpp bondgraphunittest.cpp bondgraphunittest.hpp 167 173 BondGraphUnitTest_LDADD = ${ALLLIBS} -
src/unittests/ShapeUnittest.cpp
r6b5657 r13e3c3 17 17 #include <cppunit/ui/text/TestRunner.h> 18 18 19 #include <cmath> 20 19 21 #ifdef HAVE_TESTRUNNER 20 22 #include "UnitTestMain.hpp" … … 23 25 #include "LinearAlgebra/Vector.hpp" 24 26 #include "Shapes/Shape.hpp" 27 28 #include "Shapes/BaseShapes.hpp" 25 29 26 30 // Registers the fixture into the 'registry' … … 184 188 185 189 } 190 186 191 void ShapeUnittest::operatorTest(){ 187 192 { -
tests/regression/Simple_configuration/5/pre/test.conf
r6b5657 r13e3c3 28 28 OutSrcStep 5 # Output "restart" data every ..th step 29 29 TargetTemp 0.000950045 # Target temperature 30 MaxPsiStep 0# number of Minimisation steps per state (0 - default)30 MaxPsiStep 3 # 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 0# check every ..th steps38 MaxMinGapStopStep 0# check every ..th steps37 MaxMinStopStep 1 # check every ..th steps 38 MaxMinGapStopStep 1 # 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 0# check every ..th steps45 InitMaxMinGapStopStep 0# check every ..th steps44 InitMaxMinStopStep 1 # check every ..th steps 45 InitMaxMinGapStopStep 1 # 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 0# 0 - doubly occupied, 1 - SpinUp,SpinDown56 PsiType 1 # 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 0# here: specifying maximum number of SpinDown-states59 PsiMaxNoDown 1 # 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
r6b5657 r13e3c3 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_CLEANUP 33 42 34 43 # 4. change the element … … 37 46 AT_CHECK([/bin/cp -f ${abs_top_srcdir}/${AUTOTEST_PATH}/Simple_configuration/4/pre/test.xyz test.xyz], 0) 38 47 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_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]) 39 57 AT_CHECK([file=test.xyz; diff $file ${abs_top_srcdir}/${AUTOTEST_PATH}/Simple_configuration/4/post/$file], 0, [ignore], [ignore]) 40 58 AT_CLEANUP … … 48 66 AT_CHECK([file=test.in; diff $file ${abs_top_srcdir}/${AUTOTEST_PATH}/Simple_configuration/5/post/$file], 0, [ignore], [ignore]) 49 67 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_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]) 50 77 AT_CLEANUP 51 78 … … 86 113 AT_CHECK([file=test.xyz-sorted; diff $file ${abs_top_srcdir}/${AUTOTEST_PATH}/Simple_configuration/8/post/$file], 0, [ignore], [ignore]) 87 114 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_CLEANUP 88 134 89 135 AT_SETUP([Simple configuration - Removing cuboid of atoms]) … … 95 141 AT_CHECK([/bin/cp -f ${abs_top_srcdir}/${AUTOTEST_PATH}/Simple_configuration/8/pre/test.xyz test-cuboid.xyz], 0) 96 142 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_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]) 97 162 AT_CHECK([sort -n test-cuboid.xyz | grep -v -E "^[[[:digit:]]]+" | grep -v "Created by" >test-cuboid.xyz-sorted], 0, [ignore], [ignore]) 98 163 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
r6b5657 r13e3c3 5 5 AT_CHECK([pwd],[ignore],[ignore]) 6 6 AT_CHECK([../../molecuilder -v 1], 0, [stdout], [ignore]) 7 AT_CHECK([fgrep olecuilder stdout], 0, [ignore], [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]) 8 15 AT_CLEANUP 9 16 … … 53 60 AT_CHECK([fgrep "I won't parse trajectories" stdout], 0, [ignore], [ignore]) 54 61 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, 2 68 , [ignore]) 69 AT_CLEANUP 55 70 56 71 # 7. molecule default name … … 60 75 AT_CHECK([fgrep "Default name of new molecules set to test." stdout], 0, [ignore], [ignore]) 61 76 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.