Index: src/Actions/MoleculeAction/BondFileAction.cpp
===================================================================
--- src/Actions/MoleculeAction/BondFileAction.cpp	(revision b0e9c9b269a10c150b013b7fb592c9bf4771717b)
+++ src/Actions/MoleculeAction/BondFileAction.cpp	(revision b0e9c9b269a10c150b013b7fb592c9bf4771717b)
@@ -0,0 +1,96 @@
+/*
+ * BondFileAction.cpp
+ *
+ *  Created on: May 10, 2010
+ *      Author: heber
+ */
+
+#include "Actions/MoleculeAction/BondFileAction.hpp"
+
+#include <iostream>
+#include <fstream>
+#include <string>
+
+using namespace std;
+
+#include "UIElements/UIFactory.hpp"
+#include "UIElements/Dialog.hpp"
+#include "Actions/MapOfActions.hpp"
+
+#include "atom.hpp"
+#include "bondgraph.hpp"
+#include "config.hpp"
+#include "defs.hpp"
+#include "log.hpp"
+#include "molecule.hpp"
+#include "vector.hpp"
+#include "World.hpp"
+
+/****** MoleculeBondFileAction *****/
+
+// memento to remember the state when undoing
+
+//class MoleculeBondFileState : public ActionState {
+//public:
+//  MoleculeBondFileState(molecule* _mol,std::string _lastName) :
+//    mol(_mol),
+//    lastName(_lastName)
+//  {}
+//  molecule* mol;
+//  std::string lastName;
+//};
+
+const char MoleculeBondFileAction::NAME[] = "bond-file";
+
+MoleculeBondFileAction::MoleculeBondFileAction() :
+  Action(NAME)
+{}
+
+MoleculeBondFileAction::~MoleculeBondFileAction()
+{}
+
+Action::state_ptr MoleculeBondFileAction::performCall() {
+  string filename;
+  Dialog *dialog = UIFactory::getInstance().makeDialog();
+  molecule *mol = NULL;
+
+  dialog->queryString(NAME, &filename, MapOfActions::getInstance().getDescription(NAME));
+  dialog->queryMolecule("molecule-by-id", &mol, MapOfActions::getInstance().getDescription("molecule-by-id"));
+
+  if(dialog->display()) {
+    DoLog(0) && (Log() << Verbose(0) << "Parsing bonds from " << filename << "." << endl);
+    ifstream input(filename.c_str());
+    mol->CreateAdjacencyListFromDbondFile(&input);
+    input.close();
+    delete dialog;
+    return Action::success;
+  }
+  delete dialog;
+  return Action::failure;
+}
+
+Action::state_ptr MoleculeBondFileAction::performUndo(Action::state_ptr _state) {
+//  MoleculeBondFileState *state = assert_cast<MoleculeBondFileState*>(_state.get());
+
+//  string newName = state->mol->getName();
+//  state->mol->setName(state->lastName);
+
+  return Action::failure;
+}
+
+Action::state_ptr MoleculeBondFileAction::performRedo(Action::state_ptr _state){
+  // Undo and redo have to do the same for this action
+  return performUndo(_state);
+}
+
+bool MoleculeBondFileAction::canUndo() {
+  return false;
+}
+
+bool MoleculeBondFileAction::shouldUndo() {
+  return false;
+}
+
+const string MoleculeBondFileAction::getName() {
+  return NAME;
+}
Index: src/Actions/MoleculeAction/BondFileAction.hpp
===================================================================
--- src/Actions/MoleculeAction/BondFileAction.hpp	(revision b0e9c9b269a10c150b013b7fb592c9bf4771717b)
+++ src/Actions/MoleculeAction/BondFileAction.hpp	(revision b0e9c9b269a10c150b013b7fb592c9bf4771717b)
@@ -0,0 +1,34 @@
+/*
+ * BondFileAction.hpp
+ *
+ *  Created on: May 10, 2010
+ *      Author: heber
+ */
+
+#ifndef BONDFILEACTION_HPP
+#define BONDFILEACTION_HPP
+
+#include "Actions/Action.hpp"
+#include "Actions/Process.hpp"
+
+class MoleculeListClass;
+
+class MoleculeBondFileAction : public Action {
+public:
+  MoleculeBondFileAction();
+  virtual ~MoleculeBondFileAction();
+
+  bool canUndo();
+  bool shouldUndo();
+
+  virtual const std::string getName();
+private:
+  virtual Action::state_ptr performCall();
+  virtual Action::state_ptr performUndo(Action::state_ptr);
+  virtual Action::state_ptr performRedo(Action::state_ptr);
+
+  static const char NAME[];
+};
+
+
+#endif // BONDFILEACTION_HPP
Index: src/Actions/MoleculeAction/ChangeNameAction.cpp
===================================================================
--- src/Actions/MoleculeAction/ChangeNameAction.cpp	(revision 03bb998b19ff3476cb46cd730ffbbf4258d54389)
+++ src/Actions/MoleculeAction/ChangeNameAction.cpp	(revision b0e9c9b269a10c150b013b7fb592c9bf4771717b)
@@ -15,4 +15,5 @@
 #include "UIElements/UIFactory.hpp"
 #include "UIElements/Dialog.hpp"
+#include "Actions/MapOfActions.hpp"
 
 #include "atom.hpp"
@@ -35,7 +36,6 @@
 const char MoleculeChangeNameAction::NAME[] = "Change filename of Molecule";
 
-MoleculeChangeNameAction::MoleculeChangeNameAction(MoleculeListClass *_molecules) :
-  Action(NAME),
-  molecules(_molecules)
+MoleculeChangeNameAction::MoleculeChangeNameAction() :
+  Action(NAME)
 {}
 
@@ -48,5 +48,5 @@
   Dialog *dialog = UIFactory::getInstance().makeDialog();
 
-  dialog->queryMolecule("Enter index of molecule: ",&mol,molecules);
+  dialog->queryMolecule(NAME, &mol, MapOfActions::getInstance().getDescription(NAME));
   dialog->queryString("Enter name: ",&filename);
 
Index: src/Actions/MoleculeAction/ChangeNameAction.hpp
===================================================================
--- src/Actions/MoleculeAction/ChangeNameAction.hpp	(revision 03bb998b19ff3476cb46cd730ffbbf4258d54389)
+++ src/Actions/MoleculeAction/ChangeNameAction.hpp	(revision b0e9c9b269a10c150b013b7fb592c9bf4771717b)
@@ -16,5 +16,5 @@
 class MoleculeChangeNameAction : public Action {
 public:
-  MoleculeChangeNameAction(MoleculeListClass*);
+  MoleculeChangeNameAction();
   virtual ~MoleculeChangeNameAction();
 
Index: src/Actions/MoleculeAction/FillWithMoleculeAction.cpp
===================================================================
--- src/Actions/MoleculeAction/FillWithMoleculeAction.cpp	(revision b0e9c9b269a10c150b013b7fb592c9bf4771717b)
+++ src/Actions/MoleculeAction/FillWithMoleculeAction.cpp	(revision b0e9c9b269a10c150b013b7fb592c9bf4771717b)
@@ -0,0 +1,134 @@
+/*
+ * FillWithMoleculeAction.cpp
+ *
+ *  Created on: May 10, 2010
+ *      Author: heber
+ */
+
+#include "Actions/MoleculeAction/FillWithMoleculeAction.hpp"
+
+#include <iostream>
+#include <string>
+
+using namespace std;
+
+#include "UIElements/UIFactory.hpp"
+#include "UIElements/Dialog.hpp"
+#include "Actions/MapOfActions.hpp"
+
+#include "atom.hpp"
+#include "bondgraph.hpp"
+#include "boundary.hpp"
+#include "config.hpp"
+#include "defs.hpp"
+#include "molecule.hpp"
+#include "periodentafel.hpp"
+#include "vector.hpp"
+#include "verbose.hpp"
+#include "World.hpp"
+
+/****** MoleculeFillWithMoleculeAction *****/
+
+// memento to remember the state when undoing
+
+//class MoleculeFillWithMoleculeState : public ActionState {
+//public:
+//  MoleculeFillWithMoleculeState(molecule* _mol,std::string _lastName) :
+//    mol(_mol),
+//    lastName(_lastName)
+//  {}
+//  molecule* mol;
+//  std::string lastName;
+//};
+
+const char MoleculeFillWithMoleculeAction::NAME[] = "fill-molecule";
+
+MoleculeFillWithMoleculeAction::MoleculeFillWithMoleculeAction() :
+  Action(NAME)
+{}
+
+MoleculeFillWithMoleculeAction::~MoleculeFillWithMoleculeAction()
+{}
+
+Action::state_ptr MoleculeFillWithMoleculeAction::performCall() {
+  string filename;
+  Dialog *dialog = UIFactory::getInstance().makeDialog();
+  Vector distances;
+  Vector lengths;
+  double MaxDistance = -1.;
+  bool DoRotate = false;
+
+  dialog->queryString(NAME, &filename, MapOfActions::getInstance().getDescription(NAME));
+  dialog->queryVector("distances", &distances, World::getInstance().getDomain(), false, MapOfActions::getInstance().getDescription("distances"));
+  dialog->queryVector("lengths", &lengths, World::getInstance().getDomain(), false, MapOfActions::getInstance().getDescription("lengths"));
+  dialog->queryBoolean("DoRotate", &DoRotate, MapOfActions::getInstance().getDescription("DoRotate"));
+  dialog->queryDouble("MaxDistance", &MaxDistance, MapOfActions::getInstance().getDescription("MaxDistance"));
+
+  if(dialog->display()) {
+    // construct water molecule
+    molecule *filler = World::getInstance().createMolecule();
+//    if (!filler->AddXYZFile(filename)) {
+//      DoeLog(0) && (eLog()<< Verbose(0) << "Could not parse filler molecule from " << filename << "." << endl);
+//    }
+//    filler->SetNameFromFilename(filename);
+    molecule *Filling = NULL;
+    atom *first = NULL, *second = NULL, *third = NULL;
+    first = World::getInstance().createAtom();
+    first->type = World::getInstance().getPeriode()->FindElement(1);
+    first->x = Vector(0.441, -0.143, 0.);
+    filler->AddAtom(first);
+    second = World::getInstance().createAtom();
+    second->type = World::getInstance().getPeriode()->FindElement(1);
+    second->x = Vector(-0.464, 1.137, 0.0);
+    filler->AddAtom(second);
+    third = World::getInstance().createAtom();
+    third->type = World::getInstance().getPeriode()->FindElement(8);
+    third->x = Vector(-0.464, 0.177, 0.);
+    filler->AddAtom(third);
+    filler->AddBond(first, third, 1);
+    filler->AddBond(second, third, 1);
+    World::getInstance().getConfig()->BG->ConstructBondGraph(filler);
+    filler->SetNameFromFilename("water");
+    // call routine
+    double distance[NDIM];
+    for (int i=0;i<NDIM;i++)
+      distance[i] = distances[i];
+    Filling = FillBoxWithMolecule(World::getInstance().getMolecules(), filler, *(World::getInstance().getConfig()), MaxDistance, distance, lengths[0], lengths[1], lengths[2], DoRotate);
+    if (Filling != NULL) {
+      Filling->ActiveFlag = false;
+      World::getInstance().getMolecules()->insert(Filling);
+    }
+    World::getInstance().destroyMolecule(filler);
+
+    delete dialog;
+    return Action::success;
+  }
+  delete dialog;
+  return Action::failure;
+}
+
+Action::state_ptr MoleculeFillWithMoleculeAction::performUndo(Action::state_ptr _state) {
+//  MoleculeFillWithMoleculeState *state = assert_cast<MoleculeFillWithMoleculeState*>(_state.get());
+
+//  string newName = state->mol->getName();
+//  state->mol->setName(state->lastName);
+
+  return Action::failure;
+}
+
+Action::state_ptr MoleculeFillWithMoleculeAction::performRedo(Action::state_ptr _state){
+  // Undo and redo have to do the same for this action
+  return performUndo(_state);
+}
+
+bool MoleculeFillWithMoleculeAction::canUndo() {
+  return false;
+}
+
+bool MoleculeFillWithMoleculeAction::shouldUndo() {
+  return false;
+}
+
+const string MoleculeFillWithMoleculeAction::getName() {
+  return NAME;
+}
Index: src/Actions/MoleculeAction/FillWithMoleculeAction.hpp
===================================================================
--- src/Actions/MoleculeAction/FillWithMoleculeAction.hpp	(revision b0e9c9b269a10c150b013b7fb592c9bf4771717b)
+++ src/Actions/MoleculeAction/FillWithMoleculeAction.hpp	(revision b0e9c9b269a10c150b013b7fb592c9bf4771717b)
@@ -0,0 +1,34 @@
+/*
+ * FillWithMoleculeAction.hpp
+ *
+ *  Created on: May 10, 2010
+ *      Author: heber
+ */
+
+#ifndef FILLWITHMOLECULEACTION_HPP
+#define FILLWITHMOLECULEACTION_HPP
+
+#include "Actions/Action.hpp"
+#include "Actions/Process.hpp"
+
+class MoleculeListClass;
+
+class MoleculeFillWithMoleculeAction : public Action {
+public:
+  MoleculeFillWithMoleculeAction();
+  virtual ~MoleculeFillWithMoleculeAction();
+
+  bool canUndo();
+  bool shouldUndo();
+
+  virtual const std::string getName();
+private:
+  virtual Action::state_ptr performCall();
+  virtual Action::state_ptr performUndo(Action::state_ptr);
+  virtual Action::state_ptr performRedo(Action::state_ptr);
+
+  static const char NAME[];
+};
+
+
+#endif // FILLWITHMOLECULEACTION_HPP
Index: src/Actions/MoleculeAction/LinearInterpolationofTrajectoriesAction.cpp
===================================================================
--- src/Actions/MoleculeAction/LinearInterpolationofTrajectoriesAction.cpp	(revision b0e9c9b269a10c150b013b7fb592c9bf4771717b)
+++ src/Actions/MoleculeAction/LinearInterpolationofTrajectoriesAction.cpp	(revision b0e9c9b269a10c150b013b7fb592c9bf4771717b)
@@ -0,0 +1,107 @@
+/*
+ * LinearInterpolationofTrajectoriesAction.cpp
+ *
+ *  Created on: May 10, 2010
+ *      Author: heber
+ */
+
+#include "Actions/MoleculeAction/LinearInterpolationofTrajectoriesAction.hpp"
+
+#include <iostream>
+#include <fstream>
+#include <string>
+
+using namespace std;
+
+#include "UIElements/UIFactory.hpp"
+#include "UIElements/Dialog.hpp"
+#include "Actions/MapOfActions.hpp"
+
+#include "atom.hpp"
+#include "defs.hpp"
+#include "log.hpp"
+#include "molecule.hpp"
+#include "verbose.hpp"
+#include "World.hpp"
+
+/****** MoleculeLinearInterpolationofTrajectoriesAction *****/
+
+// memento to remember the state when undoing
+
+//class MoleculeLinearInterpolationofTrajectoriesState : public ActionState {
+//public:
+//  MoleculeLinearInterpolationofTrajectoriesState(molecule* _mol,std::string _lastName) :
+//    mol(_mol),
+//    lastName(_lastName)
+//  {}
+//  molecule* mol;
+//  std::string lastName;
+//};
+
+const char MoleculeLinearInterpolationofTrajectoriesAction::NAME[] = "linear-interpolate";
+
+MoleculeLinearInterpolationofTrajectoriesAction::MoleculeLinearInterpolationofTrajectoriesAction() :
+  Action(NAME)
+{}
+
+MoleculeLinearInterpolationofTrajectoriesAction::~MoleculeLinearInterpolationofTrajectoriesAction()
+{}
+
+Action::state_ptr MoleculeLinearInterpolationofTrajectoriesAction::performCall() {
+  string filename;
+  Dialog *dialog = UIFactory::getInstance().makeDialog();
+  molecule *mol = NULL;
+  int start = -1;
+  int end = -1;
+  bool IdMapping = true;
+
+
+  dialog->queryString(NAME, &filename, MapOfActions::getInstance().getDescription(NAME));
+  dialog->queryInt("start-mol", &start, MapOfActions::getInstance().getDescription("start"));
+  dialog->queryInt("end-mol", &start, MapOfActions::getInstance().getDescription("end"));
+  dialog->queryMolecule("molecule-by-id", &mol, MapOfActions::getInstance().getDescription("molecule-by-id"));
+  dialog->queryBoolean("id-mapping", &IdMapping, MapOfActions::getInstance().getDescription("id-mapping"));
+
+  if(dialog->display()) {
+    DoLog(1) && (Log() << Verbose(1) << "Linear interpolation between configuration " << start << " and " << end << "." << endl);
+    if (IdMapping)
+      DoLog(1) && (Log() << Verbose(1) << "Using Identity for the permutation map." << endl);
+    char outputname[MAXSTRINGSIZE];
+    strcpy(outputname, filename.c_str());
+    // TODO: LinearInterpolationBetweenConfiguration should use stream, not the filename directly! (better for unit test)
+    if (!mol->LinearInterpolationBetweenConfiguration(start, end, outputname, *(World::getInstance().getConfig()), IdMapping))
+      DoLog(2) && (Log() << Verbose(2) << "Could not store " << outputname << " files." << endl);
+    else
+      DoLog(2) && (Log() << Verbose(2) << "Steps created and " << filename << " files stored." << endl);
+    delete dialog;
+    return Action::success;
+  }
+  delete dialog;
+  return Action::failure;
+}
+
+Action::state_ptr MoleculeLinearInterpolationofTrajectoriesAction::performUndo(Action::state_ptr _state) {
+//  MoleculeLinearInterpolationofTrajectoriesState *state = assert_cast<MoleculeLinearInterpolationofTrajectoriesState*>(_state.get());
+
+//  string newName = state->mol->getName();
+//  state->mol->setName(state->lastName);
+
+  return Action::failure;
+}
+
+Action::state_ptr MoleculeLinearInterpolationofTrajectoriesAction::performRedo(Action::state_ptr _state){
+  // Undo and redo have to do the same for this action
+  return performUndo(_state);
+}
+
+bool MoleculeLinearInterpolationofTrajectoriesAction::canUndo() {
+  return false;
+}
+
+bool MoleculeLinearInterpolationofTrajectoriesAction::shouldUndo() {
+  return false;
+}
+
+const string MoleculeLinearInterpolationofTrajectoriesAction::getName() {
+  return NAME;
+}
Index: src/Actions/MoleculeAction/LinearInterpolationofTrajectoriesAction.hpp
===================================================================
--- src/Actions/MoleculeAction/LinearInterpolationofTrajectoriesAction.hpp	(revision b0e9c9b269a10c150b013b7fb592c9bf4771717b)
+++ src/Actions/MoleculeAction/LinearInterpolationofTrajectoriesAction.hpp	(revision b0e9c9b269a10c150b013b7fb592c9bf4771717b)
@@ -0,0 +1,34 @@
+/*
+ * LinearInterpolationofTrajectoriesAction.hpp
+ *
+ *  Created on: May 10, 2010
+ *      Author: heber
+ */
+
+#ifndef LINEARINTERPOLATIONOFTRAJECTORIES_HPP
+#define LINEARINTERPOLATIONOFTRAJECTORIES_HPP
+
+#include "Actions/Action.hpp"
+#include "Actions/Process.hpp"
+
+class MoleculeListClass;
+
+class MoleculeLinearInterpolationofTrajectoriesAction : public Action {
+public:
+  MoleculeLinearInterpolationofTrajectoriesAction();
+  virtual ~MoleculeLinearInterpolationofTrajectoriesAction();
+
+  bool canUndo();
+  bool shouldUndo();
+
+  virtual const std::string getName();
+private:
+  virtual Action::state_ptr performCall();
+  virtual Action::state_ptr performUndo(Action::state_ptr);
+  virtual Action::state_ptr performRedo(Action::state_ptr);
+
+  static const char NAME[];
+};
+
+
+#endif // LINEARINTERPOLATIONOFTRAJECTORIES_HPP
Index: src/Actions/MoleculeAction/RotateToPrincipalAxisSystemAction.cpp
===================================================================
--- src/Actions/MoleculeAction/RotateToPrincipalAxisSystemAction.cpp	(revision b0e9c9b269a10c150b013b7fb592c9bf4771717b)
+++ src/Actions/MoleculeAction/RotateToPrincipalAxisSystemAction.cpp	(revision b0e9c9b269a10c150b013b7fb592c9bf4771717b)
@@ -0,0 +1,87 @@
+/*
+ * RotateToPrincipalAxisSystemAction.cpp
+ *
+ *  Created on: May 10, 2010
+ *      Author: heber
+ */
+
+#include "Actions/MoleculeAction/RotateToPrincipalAxisSystemAction.hpp"
+
+#include <iostream>
+#include <fstream>
+#include <string>
+
+using namespace std;
+
+#include "UIElements/UIFactory.hpp"
+#include "UIElements/Dialog.hpp"
+#include "Actions/MapOfActions.hpp"
+
+#include "log.hpp"
+#include "molecule.hpp"
+#include "verbose.hpp"
+
+/****** MoleculeRotateToPrincipalAxisSystemAction *****/
+
+// memento to remember the state when undoing
+
+//class MoleculeRotateToPrincipalAxisSystemState : public ActionState {
+//public:
+//  MoleculeRotateToPrincipalAxisSystemState(molecule* _mol,std::string _lastName) :
+//    mol(_mol),
+//    lastName(_lastName)
+//  {}
+//  molecule* mol;
+//  std::string lastName;
+//};
+
+const char MoleculeRotateToPrincipalAxisSystemAction::NAME[] = "rotate-to-pas";
+
+MoleculeRotateToPrincipalAxisSystemAction::MoleculeRotateToPrincipalAxisSystemAction() :
+  Action(NAME)
+{}
+
+MoleculeRotateToPrincipalAxisSystemAction::~MoleculeRotateToPrincipalAxisSystemAction()
+{}
+
+Action::state_ptr MoleculeRotateToPrincipalAxisSystemAction::performCall() {
+  Dialog *dialog = UIFactory::getInstance().makeDialog();
+  molecule *mol = NULL;
+
+  dialog->queryMolecule(NAME, &mol, MapOfActions::getInstance().getDescription(NAME));
+
+  if(dialog->display()) {
+    DoLog(0) && (Log() << Verbose(0) << "Converting to prinicipal axis system." << endl);
+    mol->PrincipalAxisSystem(true);
+    delete dialog;
+    return Action::success;
+  }
+  delete dialog;
+  return Action::failure;
+}
+
+Action::state_ptr MoleculeRotateToPrincipalAxisSystemAction::performUndo(Action::state_ptr _state) {
+//  MoleculeRotateToPrincipalAxisSystemState *state = assert_cast<MoleculeRotateToPrincipalAxisSystemState*>(_state.get());
+
+//  string newName = state->mol->getName();
+//  state->mol->setName(state->lastName);
+
+  return Action::failure;
+}
+
+Action::state_ptr MoleculeRotateToPrincipalAxisSystemAction::performRedo(Action::state_ptr _state){
+  // Undo and redo have to do the same for this action
+  return performUndo(_state);
+}
+
+bool MoleculeRotateToPrincipalAxisSystemAction::canUndo() {
+  return false;
+}
+
+bool MoleculeRotateToPrincipalAxisSystemAction::shouldUndo() {
+  return false;
+}
+
+const string MoleculeRotateToPrincipalAxisSystemAction::getName() {
+  return NAME;
+}
Index: src/Actions/MoleculeAction/RotateToPrincipalAxisSystemAction.hpp
===================================================================
--- src/Actions/MoleculeAction/RotateToPrincipalAxisSystemAction.hpp	(revision b0e9c9b269a10c150b013b7fb592c9bf4771717b)
+++ src/Actions/MoleculeAction/RotateToPrincipalAxisSystemAction.hpp	(revision b0e9c9b269a10c150b013b7fb592c9bf4771717b)
@@ -0,0 +1,34 @@
+/*
+ * RotateToPrincipalAxisSystemAction.hpp
+ *
+ *  Created on: May 10, 2010
+ *      Author: heber
+ */
+
+#ifndef ROTATETOPRINCIPALAXISSYSTEMACTION_HPP
+#define ROTATETOPRINCIPALAXISSYSTEMACTION_HPP
+
+#include "Actions/Action.hpp"
+#include "Actions/Process.hpp"
+
+class MoleculeListClass;
+
+class MoleculeRotateToPrincipalAxisSystemAction : public Action {
+public:
+  MoleculeRotateToPrincipalAxisSystemAction();
+  virtual ~MoleculeRotateToPrincipalAxisSystemAction();
+
+  bool canUndo();
+  bool shouldUndo();
+
+  virtual const std::string getName();
+private:
+  virtual Action::state_ptr performCall();
+  virtual Action::state_ptr performUndo(Action::state_ptr);
+  virtual Action::state_ptr performRedo(Action::state_ptr);
+
+  static const char NAME[];
+};
+
+
+#endif // ROTATETOPRINCIPALAXISSYSTEMACTION_HPP
Index: src/Actions/MoleculeAction/SaveAdjacencyAction.cpp
===================================================================
--- src/Actions/MoleculeAction/SaveAdjacencyAction.cpp	(revision b0e9c9b269a10c150b013b7fb592c9bf4771717b)
+++ src/Actions/MoleculeAction/SaveAdjacencyAction.cpp	(revision b0e9c9b269a10c150b013b7fb592c9bf4771717b)
@@ -0,0 +1,99 @@
+/*
+ * SaveAdjacencyAction.cpp
+ *
+ *  Created on: May 10, 2010
+ *      Author: heber
+ */
+
+#include "Actions/MoleculeAction/SaveAdjacencyAction.hpp"
+
+#include <iostream>
+#include <fstream>
+#include <string>
+
+using namespace std;
+
+#include "UIElements/UIFactory.hpp"
+#include "UIElements/Dialog.hpp"
+#include "Actions/MapOfActions.hpp"
+
+#include "atom.hpp"
+#include "bondgraph.hpp"
+#include "config.hpp"
+#include "defs.hpp"
+#include "log.hpp"
+#include "molecule.hpp"
+#include "vector.hpp"
+#include "verbose.hpp"
+#include "World.hpp"
+
+/****** MoleculeSaveAdjacencyAction *****/
+
+// memento to remember the state when undoing
+
+//class MoleculeSaveAdjacencyState : public ActionState {
+//public:
+//  MoleculeSaveAdjacencyState(molecule* _mol,std::string _lastName) :
+//    mol(_mol),
+//    lastName(_lastName)
+//  {}
+//  molecule* mol;
+//  std::string lastName;
+//};
+
+const char MoleculeSaveAdjacencyAction::NAME[] = "save-adjacency";
+
+MoleculeSaveAdjacencyAction::MoleculeSaveAdjacencyAction() :
+  Action(NAME)
+{}
+
+MoleculeSaveAdjacencyAction::~MoleculeSaveAdjacencyAction()
+{}
+
+Action::state_ptr MoleculeSaveAdjacencyAction::performCall() {
+  string filename;
+  Dialog *dialog = UIFactory::getInstance().makeDialog();
+  molecule *mol = NULL;
+
+  dialog->queryString(NAME, &filename, MapOfActions::getInstance().getDescription(NAME));
+  dialog->queryMolecule("molecule-by-id", &mol, MapOfActions::getInstance().getDescription("molecule-by-id"));
+
+  if(dialog->display()) {
+    DoLog(0) && (Log() << Verbose(0) << "Storing adjacency to path " << filename << "." << endl);
+    World::getInstance().getConfig()->BG->ConstructBondGraph(mol);
+    // TODO: sollte stream nicht filename benutzen, besser fuer unit test
+    char outputname[MAXSTRINGSIZE];
+    strcpy(outputname, filename.c_str());
+    mol->StoreAdjacencyToFile(NULL, outputname);
+    delete dialog;
+    return Action::success;
+  }
+  delete dialog;
+  return Action::failure;
+}
+
+Action::state_ptr MoleculeSaveAdjacencyAction::performUndo(Action::state_ptr _state) {
+//  MoleculeSaveAdjacencyState *state = assert_cast<MoleculeSaveAdjacencyState*>(_state.get());
+
+//  string newName = state->mol->getName();
+//  state->mol->setName(state->lastName);
+
+  return Action::failure;
+}
+
+Action::state_ptr MoleculeSaveAdjacencyAction::performRedo(Action::state_ptr _state){
+  // Undo and redo have to do the same for this action
+  return performUndo(_state);
+}
+
+bool MoleculeSaveAdjacencyAction::canUndo() {
+  return false;
+}
+
+bool MoleculeSaveAdjacencyAction::shouldUndo() {
+  return false;
+}
+
+const string MoleculeSaveAdjacencyAction::getName() {
+  return NAME;
+}
Index: src/Actions/MoleculeAction/SaveAdjacencyAction.hpp
===================================================================
--- src/Actions/MoleculeAction/SaveAdjacencyAction.hpp	(revision b0e9c9b269a10c150b013b7fb592c9bf4771717b)
+++ src/Actions/MoleculeAction/SaveAdjacencyAction.hpp	(revision b0e9c9b269a10c150b013b7fb592c9bf4771717b)
@@ -0,0 +1,34 @@
+/*
+ * SaveAdjacencyAction.hpp
+ *
+ *  Created on: May 10, 2010
+ *      Author: heber
+ */
+
+#ifndef SAVEADJACENCYACTION_HPP
+#define SAVEADJACENCYACTION_HPP
+
+#include "Actions/Action.hpp"
+#include "Actions/Process.hpp"
+
+class MoleculeListClass;
+
+class MoleculeSaveAdjacencyAction : public Action {
+public:
+  MoleculeSaveAdjacencyAction();
+  virtual ~MoleculeSaveAdjacencyAction();
+
+  bool canUndo();
+  bool shouldUndo();
+
+  virtual const std::string getName();
+private:
+  virtual Action::state_ptr performCall();
+  virtual Action::state_ptr performUndo(Action::state_ptr);
+  virtual Action::state_ptr performRedo(Action::state_ptr);
+
+  static const char NAME[];
+};
+
+
+#endif // SAVEADJACENCYACTION_HPP
Index: src/Actions/MoleculeAction/SaveBondsAction.cpp
===================================================================
--- src/Actions/MoleculeAction/SaveBondsAction.cpp	(revision b0e9c9b269a10c150b013b7fb592c9bf4771717b)
+++ src/Actions/MoleculeAction/SaveBondsAction.cpp	(revision b0e9c9b269a10c150b013b7fb592c9bf4771717b)
@@ -0,0 +1,99 @@
+/*
+ * SaveBondsAction.cpp
+ *
+ *  Created on: May 10, 2010
+ *      Author: heber
+ */
+
+#include "Actions/MoleculeAction/SaveBondsAction.hpp"
+
+#include <iostream>
+#include <fstream>
+#include <string>
+
+using namespace std;
+
+#include "UIElements/UIFactory.hpp"
+#include "UIElements/Dialog.hpp"
+#include "Actions/MapOfActions.hpp"
+
+#include "atom.hpp"
+#include "bondgraph.hpp"
+#include "config.hpp"
+#include "defs.hpp"
+#include "log.hpp"
+#include "molecule.hpp"
+#include "vector.hpp"
+#include "verbose.hpp"
+#include "World.hpp"
+
+/****** MoleculeSaveBondsAction *****/
+
+// memento to remember the state when undoing
+
+//class MoleculeSaveBondsState : public ActionState {
+//public:
+//  MoleculeSaveBondsState(molecule* _mol,std::string _lastName) :
+//    mol(_mol),
+//    lastName(_lastName)
+//  {}
+//  molecule* mol;
+//  std::string lastName;
+//};
+
+const char MoleculeSaveBondsAction::NAME[] = "save-bonds";
+
+MoleculeSaveBondsAction::MoleculeSaveBondsAction() :
+  Action(NAME)
+{}
+
+MoleculeSaveBondsAction::~MoleculeSaveBondsAction()
+{}
+
+Action::state_ptr MoleculeSaveBondsAction::performCall() {
+  string filename;
+  Dialog *dialog = UIFactory::getInstance().makeDialog();
+  molecule *mol = NULL;
+
+  dialog->queryString(NAME, &filename, MapOfActions::getInstance().getDescription(NAME));
+  dialog->queryMolecule("molecule-by-id", &mol, MapOfActions::getInstance().getDescription("molecule-by-id"));
+
+  if(dialog->display()) {
+    DoLog(0) && (Log() << Verbose(0) << "Storing bonds to path " << filename << "." << endl);
+    World::getInstance().getConfig()->BG->ConstructBondGraph(mol);
+    // TODO: sollte stream, nicht filenamen direkt nutzen, beser fuer unit tests
+    char outputname[MAXSTRINGSIZE];
+    strcpy(outputname, filename.c_str());
+    mol->StoreBondsToFile(NULL, outputname);
+    delete dialog;
+    return Action::success;
+  }
+  delete dialog;
+  return Action::failure;
+}
+
+Action::state_ptr MoleculeSaveBondsAction::performUndo(Action::state_ptr _state) {
+//  MoleculeSaveBondsState *state = assert_cast<MoleculeSaveBondsState*>(_state.get());
+
+//  string newName = state->mol->getName();
+//  state->mol->setName(state->lastName);
+
+  return Action::failure;
+}
+
+Action::state_ptr MoleculeSaveBondsAction::performRedo(Action::state_ptr _state){
+  // Undo and redo have to do the same for this action
+  return performUndo(_state);
+}
+
+bool MoleculeSaveBondsAction::canUndo() {
+  return false;
+}
+
+bool MoleculeSaveBondsAction::shouldUndo() {
+  return false;
+}
+
+const string MoleculeSaveBondsAction::getName() {
+  return NAME;
+}
Index: src/Actions/MoleculeAction/SaveBondsAction.hpp
===================================================================
--- src/Actions/MoleculeAction/SaveBondsAction.hpp	(revision b0e9c9b269a10c150b013b7fb592c9bf4771717b)
+++ src/Actions/MoleculeAction/SaveBondsAction.hpp	(revision b0e9c9b269a10c150b013b7fb592c9bf4771717b)
@@ -0,0 +1,34 @@
+/*
+ * SaveBondsAction.hpp
+ *
+ *  Created on: May 10, 2010
+ *      Author: heber
+ */
+
+#ifndef SAVEBONDSACTION_HPP
+#define SAVEBONDSACTION_HPP
+
+#include "Actions/Action.hpp"
+#include "Actions/Process.hpp"
+
+class MoleculeListClass;
+
+class MoleculeSaveBondsAction : public Action {
+public:
+  MoleculeSaveBondsAction();
+  virtual ~MoleculeSaveBondsAction();
+
+  bool canUndo();
+  bool shouldUndo();
+
+  virtual const std::string getName();
+private:
+  virtual Action::state_ptr performCall();
+  virtual Action::state_ptr performUndo(Action::state_ptr);
+  virtual Action::state_ptr performRedo(Action::state_ptr);
+
+  static const char NAME[];
+};
+
+
+#endif // SAVEBONDSACTION_HPP
Index: src/Actions/MoleculeAction/SaveTemperatureAction.cpp
===================================================================
--- src/Actions/MoleculeAction/SaveTemperatureAction.cpp	(revision b0e9c9b269a10c150b013b7fb592c9bf4771717b)
+++ src/Actions/MoleculeAction/SaveTemperatureAction.cpp	(revision b0e9c9b269a10c150b013b7fb592c9bf4771717b)
@@ -0,0 +1,97 @@
+/*
+ * SaveTemperatureAction.cpp
+ *
+ *  Created on: May 10, 2010
+ *      Author: heber
+ */
+
+#include "Actions/MoleculeAction/SaveTemperatureAction.hpp"
+
+#include <iostream>
+#include <fstream>
+#include <string>
+
+using namespace std;
+
+#include "UIElements/UIFactory.hpp"
+#include "UIElements/Dialog.hpp"
+#include "Actions/MapOfActions.hpp"
+
+#include "atom.hpp"
+#include "log.hpp"
+#include "molecule.hpp"
+#include "verbose.hpp"
+#include "World.hpp"
+
+/****** MoleculeSaveTemperatureAction *****/
+
+// memento to remember the state when undoing
+
+//class MoleculeSaveTemperatureState : public ActionState {
+//public:
+//  MoleculeSaveTemperatureState(molecule* _mol,std::string _lastName) :
+//    mol(_mol),
+//    lastName(_lastName)
+//  {}
+//  molecule* mol;
+//  std::string lastName;
+//};
+
+const char MoleculeSaveTemperatureAction::NAME[] = "save-temperature";
+
+MoleculeSaveTemperatureAction::MoleculeSaveTemperatureAction() :
+  Action(NAME)
+{}
+
+MoleculeSaveTemperatureAction::~MoleculeSaveTemperatureAction()
+{}
+
+Action::state_ptr MoleculeSaveTemperatureAction::performCall() {
+  string filename;
+  Dialog *dialog = UIFactory::getInstance().makeDialog();
+  molecule *mol = NULL;
+
+  dialog->queryString(NAME, &filename, MapOfActions::getInstance().getDescription(NAME));
+  dialog->queryMolecule("molecule-by-id", &mol, MapOfActions::getInstance().getDescription("molecule-by-id"));
+
+  if(dialog->display()) {
+    DoLog(1) && (Log() << Verbose(1) << "Storing temperatures in " << filename << "." << endl);
+    ofstream output;
+    output.open(filename.c_str(), ios::trunc);
+    if (output.fail() || !mol->OutputTemperatureFromTrajectories((ofstream * const) &output, 0, mol->MDSteps))
+      DoLog(2) && (Log() << Verbose(2) << "File could not be written." << endl);
+    else
+      DoLog(2) && (Log() << Verbose(2) << "File stored." << endl);
+    output.close();
+    delete dialog;
+    return Action::success;
+  }
+  delete dialog;
+  return Action::failure;
+}
+
+Action::state_ptr MoleculeSaveTemperatureAction::performUndo(Action::state_ptr _state) {
+//  MoleculeSaveTemperatureState *state = assert_cast<MoleculeSaveTemperatureState*>(_state.get());
+
+//  string newName = state->mol->getName();
+//  state->mol->setName(state->lastName);
+
+  return Action::failure;
+}
+
+Action::state_ptr MoleculeSaveTemperatureAction::performRedo(Action::state_ptr _state){
+  // Undo and redo have to do the same for this action
+  return performUndo(_state);
+}
+
+bool MoleculeSaveTemperatureAction::canUndo() {
+  return false;
+}
+
+bool MoleculeSaveTemperatureAction::shouldUndo() {
+  return false;
+}
+
+const string MoleculeSaveTemperatureAction::getName() {
+  return NAME;
+}
Index: src/Actions/MoleculeAction/SaveTemperatureAction.hpp
===================================================================
--- src/Actions/MoleculeAction/SaveTemperatureAction.hpp	(revision b0e9c9b269a10c150b013b7fb592c9bf4771717b)
+++ src/Actions/MoleculeAction/SaveTemperatureAction.hpp	(revision b0e9c9b269a10c150b013b7fb592c9bf4771717b)
@@ -0,0 +1,34 @@
+/*
+ * SaveTemperatureAction.hpp
+ *
+ *  Created on: May 10, 2010
+ *      Author: heber
+ */
+
+#ifndef SAVETEMPERATUREACTION_HPP
+#define SAVETEMPERATUREACTION_HPP
+
+#include "Actions/Action.hpp"
+#include "Actions/Process.hpp"
+
+class MoleculeListClass;
+
+class MoleculeSaveTemperatureAction : public Action {
+public:
+  MoleculeSaveTemperatureAction();
+  virtual ~MoleculeSaveTemperatureAction();
+
+  bool canUndo();
+  bool shouldUndo();
+
+  virtual const std::string getName();
+private:
+  virtual Action::state_ptr performCall();
+  virtual Action::state_ptr performUndo(Action::state_ptr);
+  virtual Action::state_ptr performRedo(Action::state_ptr);
+
+  static const char NAME[];
+};
+
+
+#endif // SAVETEMPERATUREACTION_HPP
Index: src/Actions/MoleculeAction/SuspendInWaterAction.cpp
===================================================================
--- src/Actions/MoleculeAction/SuspendInWaterAction.cpp	(revision b0e9c9b269a10c150b013b7fb592c9bf4771717b)
+++ src/Actions/MoleculeAction/SuspendInWaterAction.cpp	(revision b0e9c9b269a10c150b013b7fb592c9bf4771717b)
@@ -0,0 +1,96 @@
+/*
+ * SuspendInWaterAction.cpp
+ *
+ *  Created on: May 12, 2010
+ *      Author: heber
+ */
+
+#include "Actions/MoleculeAction/SuspendInWaterAction.hpp"
+
+#include <iostream>
+#include <string>
+
+using namespace std;
+
+#include "UIElements/UIFactory.hpp"
+#include "UIElements/Dialog.hpp"
+#include "Actions/MapOfActions.hpp"
+
+#include "atom.hpp"
+#include "boundary.hpp"
+#include "config.hpp"
+#include "log.hpp"
+#include "config.hpp"
+#include "World.hpp"
+
+/****** MoleculeSuspendInWaterAction *****/
+
+// memento to remember the state when undoing
+
+//class MoleculeSuspendInWaterState : public ActionState {
+//public:
+//  MoleculeSuspendInWaterState(molecule* _mol,std::string _lastName) :
+//    mol(_mol),
+//    lastName(_lastName)
+//  {}
+//  molecule* mol;
+//  std::string lastName;
+//};
+
+const char MoleculeSuspendInWaterAction::NAME[] = "suspend-in-water";
+
+MoleculeSuspendInWaterAction::MoleculeSuspendInWaterAction() :
+  Action(NAME)
+{}
+
+MoleculeSuspendInWaterAction::~MoleculeSuspendInWaterAction()
+{}
+
+Action::state_ptr MoleculeSuspendInWaterAction::performCall() {
+  molecule *mol = NULL;
+  Dialog *dialog = UIFactory::getInstance().makeDialog();
+  double density;
+  double volume = 0.;
+
+  dialog->queryMolecule(NAME, &mol, MapOfActions::getInstance().getDescription(NAME));
+  dialog->queryDouble("density", &density, MapOfActions::getInstance().getDescription("density"));
+
+  if(dialog->display()) {
+    DoLog(0) && (Log() << Verbose(0) << "Evaluating necessary cell volume for a cluster suspended in water.");
+    if (density < 1.0) {
+      DoeLog(1) && (eLog()<< Verbose(1) << "Density must be greater than 1.0g/cm^3!" << endl);
+    } else {
+      PrepareClustersinWater(World::getInstance().getConfig(), mol, volume, density);  // if volume == 0, will calculate from ConvexEnvelope
+      delete dialog;
+      return Action::success;
+    }
+  }
+  delete dialog;
+  return Action::failure;
+}
+
+Action::state_ptr MoleculeSuspendInWaterAction::performUndo(Action::state_ptr _state) {
+//  MoleculeSuspendInWaterState *state = assert_cast<MoleculeSuspendInWaterState*>(_state.get());
+
+//  string newName = state->mol->getName();
+//  state->mol->setName(state->lastName);
+
+  return Action::failure;
+}
+
+Action::state_ptr MoleculeSuspendInWaterAction::performRedo(Action::state_ptr _state){
+  // Undo and redo have to do the same for this action
+  return performUndo(_state);
+}
+
+bool MoleculeSuspendInWaterAction::canUndo() {
+  return false;
+}
+
+bool MoleculeSuspendInWaterAction::shouldUndo() {
+  return false;
+}
+
+const string MoleculeSuspendInWaterAction::getName() {
+  return NAME;
+}
Index: src/Actions/MoleculeAction/SuspendInWaterAction.hpp
===================================================================
--- src/Actions/MoleculeAction/SuspendInWaterAction.hpp	(revision b0e9c9b269a10c150b013b7fb592c9bf4771717b)
+++ src/Actions/MoleculeAction/SuspendInWaterAction.hpp	(revision b0e9c9b269a10c150b013b7fb592c9bf4771717b)
@@ -0,0 +1,34 @@
+/*
+ * SuspendInWaterAction.hpp
+ *
+ *  Created on: May 12, 2010
+ *      Author: heber
+ */
+
+#ifndef SUSPENDINWATERACTION_HPP
+#define SUSPENDINWATERACTION_HPP
+
+#include "Actions/Action.hpp"
+#include "Actions/Process.hpp"
+
+class MoleculeListClass;
+
+class MoleculeSuspendInWaterAction : public Action {
+public:
+  MoleculeSuspendInWaterAction();
+  virtual ~MoleculeSuspendInWaterAction();
+
+  bool canUndo();
+  bool shouldUndo();
+
+  virtual const std::string getName();
+private:
+  virtual Action::state_ptr performCall();
+  virtual Action::state_ptr performUndo(Action::state_ptr);
+  virtual Action::state_ptr performRedo(Action::state_ptr);
+
+  static const char NAME[];
+};
+
+
+#endif // SUSPENDINWATERACTION_HPP
Index: src/Actions/MoleculeAction/TranslateAction.cpp
===================================================================
--- src/Actions/MoleculeAction/TranslateAction.cpp	(revision b0e9c9b269a10c150b013b7fb592c9bf4771717b)
+++ src/Actions/MoleculeAction/TranslateAction.cpp	(revision b0e9c9b269a10c150b013b7fb592c9bf4771717b)
@@ -0,0 +1,96 @@
+/*
+ * TranslateAction.cpp
+ *
+ *  Created on: May 10, 2010
+ *      Author: heber
+ */
+
+#include "Actions/MoleculeAction/TranslateAction.hpp"
+
+#include <iostream>
+#include <fstream>
+#include <string>
+
+using namespace std;
+
+#include "UIElements/UIFactory.hpp"
+#include "UIElements/Dialog.hpp"
+#include "Actions/MapOfActions.hpp"
+
+#include "atom.hpp"
+#include "log.hpp"
+#include "molecule.hpp"
+#include "verbose.hpp"
+#include "World.hpp"
+
+/****** MoleculeTranslateAction *****/
+
+// memento to remember the state when undoing
+
+//class MoleculeTranslateState : public ActionState {
+//public:
+//  MoleculeTranslateState(molecule* _mol,std::string _lastName) :
+//    mol(_mol),
+//    lastName(_lastName)
+//  {}
+//  molecule* mol;
+//  std::string lastName;
+//};
+
+const char MoleculeTranslateAction::NAME[] = "translate-mol";
+
+MoleculeTranslateAction::MoleculeTranslateAction() :
+  Action(NAME)
+{}
+
+MoleculeTranslateAction::~MoleculeTranslateAction()
+{}
+
+Action::state_ptr MoleculeTranslateAction::performCall() {
+  Dialog *dialog = UIFactory::getInstance().makeDialog();
+  molecule *mol = NULL;
+  Vector x;
+  bool periodic = false;
+
+  dialog->queryVector(NAME, &x, World::getInstance().getDomain(), false, MapOfActions::getInstance().getDescription(NAME));
+  dialog->queryMolecule("molecule-by-id", &mol, MapOfActions::getInstance().getDescription("molecule-by-id"));
+  dialog->queryBoolean("periodic", &periodic, MapOfActions::getInstance().getDescription("periodic"));
+
+  if(dialog->display()) {
+    DoLog(1) && (Log() << Verbose(1) << "Translating all ions by given vector." << endl);
+    if (periodic)
+      mol->TranslatePeriodically((const Vector *)&x);
+    else
+      mol->Translate((const Vector *)&x);
+    delete dialog;
+    return Action::success;
+  }
+  delete dialog;
+  return Action::failure;
+}
+
+Action::state_ptr MoleculeTranslateAction::performUndo(Action::state_ptr _state) {
+//  MoleculeTranslateState *state = assert_cast<MoleculeTranslateState*>(_state.get());
+
+//  string newName = state->mol->getName();
+//  state->mol->setName(state->lastName);
+
+  return Action::failure;
+}
+
+Action::state_ptr MoleculeTranslateAction::performRedo(Action::state_ptr _state){
+  // Undo and redo have to do the same for this action
+  return performUndo(_state);
+}
+
+bool MoleculeTranslateAction::canUndo() {
+  return false;
+}
+
+bool MoleculeTranslateAction::shouldUndo() {
+  return false;
+}
+
+const string MoleculeTranslateAction::getName() {
+  return NAME;
+}
Index: src/Actions/MoleculeAction/TranslateAction.hpp
===================================================================
--- src/Actions/MoleculeAction/TranslateAction.hpp	(revision b0e9c9b269a10c150b013b7fb592c9bf4771717b)
+++ src/Actions/MoleculeAction/TranslateAction.hpp	(revision b0e9c9b269a10c150b013b7fb592c9bf4771717b)
@@ -0,0 +1,34 @@
+/*
+ * TranslateAction.hpp
+ *
+ *  Created on: May 10, 2010
+ *      Author: heber
+ */
+
+#ifndef TRANSLATEACTION_HPP
+#define TRANSLATEACTION_HPP
+
+#include "Actions/Action.hpp"
+#include "Actions/Process.hpp"
+
+class MoleculeListClass;
+
+class MoleculeTranslateAction : public Action {
+public:
+  MoleculeTranslateAction();
+  virtual ~MoleculeTranslateAction();
+
+  bool canUndo();
+  bool shouldUndo();
+
+  virtual const std::string getName();
+private:
+  virtual Action::state_ptr performCall();
+  virtual Action::state_ptr performUndo(Action::state_ptr);
+  virtual Action::state_ptr performRedo(Action::state_ptr);
+
+  static const char NAME[];
+};
+
+
+#endif // TRANSLATEACTION_HPP
Index: src/Actions/MoleculeAction/VerletIntegrationAction.cpp
===================================================================
--- src/Actions/MoleculeAction/VerletIntegrationAction.cpp	(revision b0e9c9b269a10c150b013b7fb592c9bf4771717b)
+++ src/Actions/MoleculeAction/VerletIntegrationAction.cpp	(revision b0e9c9b269a10c150b013b7fb592c9bf4771717b)
@@ -0,0 +1,98 @@
+/*
+ * VerletIntegrationAction.cpp
+ *
+ *  Created on: May 10, 2010
+ *      Author: heber
+ */
+
+#include "Actions/MoleculeAction/VerletIntegrationAction.hpp"
+
+#include <iostream>
+#include <fstream>
+#include <string>
+
+using namespace std;
+
+#include "UIElements/UIFactory.hpp"
+#include "UIElements/Dialog.hpp"
+#include "Actions/MapOfActions.hpp"
+
+#include "atom.hpp"
+#include "log.hpp"
+#include "molecule.hpp"
+#include "verbose.hpp"
+#include "World.hpp"
+
+/****** MoleculeVerletIntegrationAction *****/
+
+// memento to remember the state when undoing
+
+//class MoleculeVerletIntegrationState : public ActionState {
+//public:
+//  MoleculeVerletIntegrationState(molecule* _mol,std::string _lastName) :
+//    mol(_mol),
+//    lastName(_lastName)
+//  {}
+//  molecule* mol;
+//  std::string lastName;
+//};
+
+const char MoleculeVerletIntegrationAction::NAME[] = "verlet-integrate";
+
+MoleculeVerletIntegrationAction::MoleculeVerletIntegrationAction() :
+  Action(NAME)
+{}
+
+MoleculeVerletIntegrationAction::~MoleculeVerletIntegrationAction()
+{}
+
+Action::state_ptr MoleculeVerletIntegrationAction::performCall() {
+  string filename;
+  Dialog *dialog = UIFactory::getInstance().makeDialog();
+  molecule *mol = NULL;
+
+  dialog->queryString(NAME, &filename, MapOfActions::getInstance().getDescription(NAME));
+  dialog->queryMolecule("molecule-by-id", &mol, MapOfActions::getInstance().getDescription("molecule-by-id"));
+
+  if(dialog->display()) {
+    DoLog(1) && (Log() << Verbose(1) << "Parsing forces file and Verlet integrating." << endl);
+    // TODO: sollte besser stream nutzen, nicht filename direkt (es sei denn, ist prefix), besser fuer unit test
+    char outputname[MAXSTRINGSIZE];
+    strcpy(outputname, filename.c_str());
+    if (!mol->VerletForceIntegration(outputname, *(World::getInstance().getConfig())))
+      DoLog(2) && (Log() << Verbose(2) << "File not found." << endl);
+    else
+      DoLog(2) && (Log() << Verbose(2) << "File found and parsed." << endl);
+
+    delete dialog;
+    return Action::success;
+  }
+  delete dialog;
+  return Action::failure;
+}
+
+Action::state_ptr MoleculeVerletIntegrationAction::performUndo(Action::state_ptr _state) {
+//  MoleculeVerletIntegrationState *state = assert_cast<MoleculeVerletIntegrationState*>(_state.get());
+
+//  string newName = state->mol->getName();
+//  state->mol->setName(state->lastName);
+
+  return Action::failure;
+}
+
+Action::state_ptr MoleculeVerletIntegrationAction::performRedo(Action::state_ptr _state){
+  // Undo and redo have to do the same for this action
+  return performUndo(_state);
+}
+
+bool MoleculeVerletIntegrationAction::canUndo() {
+  return false;
+}
+
+bool MoleculeVerletIntegrationAction::shouldUndo() {
+  return false;
+}
+
+const string MoleculeVerletIntegrationAction::getName() {
+  return NAME;
+}
Index: src/Actions/MoleculeAction/VerletIntegrationAction.hpp
===================================================================
--- src/Actions/MoleculeAction/VerletIntegrationAction.hpp	(revision b0e9c9b269a10c150b013b7fb592c9bf4771717b)
+++ src/Actions/MoleculeAction/VerletIntegrationAction.hpp	(revision b0e9c9b269a10c150b013b7fb592c9bf4771717b)
@@ -0,0 +1,34 @@
+/*
+ * VerletIntegrationAction.hpp
+ *
+ *  Created on: May 10, 2010
+ *      Author: heber
+ */
+
+#ifndef VERLETINTEGRATIONACTION_HPP
+#define VERLETINTEGRATIONACTION_HPP
+
+#include "Actions/Action.hpp"
+#include "Actions/Process.hpp"
+
+class MoleculeListClass;
+
+class MoleculeVerletIntegrationAction : public Action {
+public:
+  MoleculeVerletIntegrationAction();
+  virtual ~MoleculeVerletIntegrationAction();
+
+  bool canUndo();
+  bool shouldUndo();
+
+  virtual const std::string getName();
+private:
+  virtual Action::state_ptr performCall();
+  virtual Action::state_ptr performUndo(Action::state_ptr);
+  virtual Action::state_ptr performRedo(Action::state_ptr);
+
+  static const char NAME[];
+};
+
+
+#endif // VERLETINTEGRATIONACTION_HPP
