Index: configure.ac
===================================================================
--- configure.ac	(revision 12872df33639e521d4b0225d6064ea91bd4f18e8)
+++ configure.ac	(revision f941b14c7a92d23575eccdfcd7bbb7ef127d1bad)
@@ -28,5 +28,5 @@
 # Boost libraries
 AX_BOOST_BASE([1.33.1])
-#AX_BOOST_PROGRAM_OPTIONS
+AX_BOOST_PROGRAM_OPTIONS
 #AX_BOOST_FOREACH
 #AX_BOOST_FILESYSTEM
Index: src/Actions/ActionRegistry.cpp
===================================================================
--- src/Actions/ActionRegistry.cpp	(revision 12872df33639e521d4b0225d6064ea91bd4f18e8)
+++ src/Actions/ActionRegistry.cpp	(revision f941b14c7a92d23575eccdfcd7bbb7ef127d1bad)
@@ -43,3 +43,17 @@
 }
 
+void ActionRegistry::unregisterAction(Action* action){
+  actionMap.erase(action->getName());
+}
+
+std::map<const std::string,Action*>::iterator ActionRegistry::getBeginIter()
+{
+  return actionMap.begin();
+}
+
+std::map<const std::string,Action*>::iterator ActionRegistry::getEndIter()
+{
+  return actionMap.end();
+}
+
 CONSTRUCT_SINGLETON(ActionRegistry)
Index: src/Actions/ActionRegistry.hpp
===================================================================
--- src/Actions/ActionRegistry.hpp	(revision 12872df33639e521d4b0225d6064ea91bd4f18e8)
+++ src/Actions/ActionRegistry.hpp	(revision f941b14c7a92d23575eccdfcd7bbb7ef127d1bad)
@@ -22,4 +22,8 @@
   Action* getActionByName(const std::string);
   void registerAction(Action*);
+  void unregisterAction(Action*);
+
+  std::map<const std::string,Action*>::iterator getBeginIter();
+  std::map<const std::string,Action*>::iterator getEndIter();
 
 private:
Index: src/Actions/AnalysisAction/MolecularVolumeAction.cpp
===================================================================
--- src/Actions/AnalysisAction/MolecularVolumeAction.cpp	(revision f941b14c7a92d23575eccdfcd7bbb7ef127d1bad)
+++ src/Actions/AnalysisAction/MolecularVolumeAction.cpp	(revision f941b14c7a92d23575eccdfcd7bbb7ef127d1bad)
@@ -0,0 +1,89 @@
+/*
+ * MolecularVolumeAction.cpp
+ *
+ *  Created on: May 12, 2010
+ *      Author: heber
+ */
+
+#include "Actions/AnalysisAction/MolecularVolumeAction.hpp"
+#include "CommandLineParser.hpp"
+#include "boundary.hpp"
+#include "config.hpp"
+#include "molecule.hpp"
+#include "linkedcell.hpp"
+#include "log.hpp"
+#include "verbose.hpp"
+#include "World.hpp"
+
+#include <iostream>
+#include <string>
+
+using namespace std;
+
+#include "UIElements/UIFactory.hpp"
+#include "UIElements/Dialog.hpp"
+#include "Actions/MapOfActions.hpp"
+
+const char AnalysisMolecularVolumeAction::NAME[] = "molecular-volume";
+
+AnalysisMolecularVolumeAction::AnalysisMolecularVolumeAction() :
+  Action(NAME)
+{}
+
+AnalysisMolecularVolumeAction::~AnalysisMolecularVolumeAction()
+{}
+
+Action::state_ptr AnalysisMolecularVolumeAction::performCall() {
+  Dialog *dialog = UIFactory::getInstance().makeDialog();
+  molecule *mol = NULL;
+
+  dialog->queryMolecule(NAME, &mol, MapOfActions::getInstance().getDescription(NAME));
+
+  if(dialog->display()) {
+    class Tesselation *TesselStruct = NULL;
+    const LinkedCell *LCList = NULL;
+    DoLog(0) && (Log() << Verbose(0) << "Evaluating volume of the convex envelope.");
+    LCList = new LinkedCell(mol, 10.);
+    config * const configuration = World::getInstance().getConfig();
+    //FindConvexBorder(mol, LCList, argv[argptr]);
+    FindNonConvexBorder(mol, TesselStruct, LCList, 5., NULL);
+    //RemoveAllBoundaryPoints(TesselStruct, mol, argv[argptr]);
+    double volumedifference = ConvexizeNonconvexEnvelope(TesselStruct, mol, NULL);
+    double clustervolume = VolumeOfConvexEnvelope(TesselStruct, configuration);
+    DoLog(0) && (Log() << Verbose(0) << "The tesselated volume area is " << clustervolume << " " << (configuration->GetIsAngstroem() ? "angstrom" : "atomiclength") << "^3." << endl);
+    DoLog(0) && (Log() << Verbose(0) << "The non-convex tesselated volume area is " << clustervolume-volumedifference << " " << (configuration->GetIsAngstroem() ? "angstrom" : "atomiclength") << "^3." << endl);
+    delete(TesselStruct);
+    delete(LCList);
+    delete dialog;
+    return Action::success;
+  } else {
+    delete dialog;
+    return Action::failure;
+  }
+}
+
+Action::state_ptr AnalysisMolecularVolumeAction::performUndo(Action::state_ptr _state) {
+//  ParserLoadXyzState *state = assert_cast<ParserLoadXyzState*>(_state.get());
+
+  return Action::failure;
+//  string newName = state->mol->getName();
+//  state->mol->setName(state->lastName);
+//
+//  return Action::state_ptr(new ParserLoadXyzState(state->mol,newName));
+}
+
+Action::state_ptr AnalysisMolecularVolumeAction::performRedo(Action::state_ptr _state){
+  return Action::failure;
+}
+
+bool AnalysisMolecularVolumeAction::canUndo() {
+  return false;
+}
+
+bool AnalysisMolecularVolumeAction::shouldUndo() {
+  return false;
+}
+
+const string AnalysisMolecularVolumeAction::getName() {
+  return NAME;
+}
Index: src/Actions/AnalysisAction/MolecularVolumeAction.hpp
===================================================================
--- src/Actions/AnalysisAction/MolecularVolumeAction.hpp	(revision f941b14c7a92d23575eccdfcd7bbb7ef127d1bad)
+++ src/Actions/AnalysisAction/MolecularVolumeAction.hpp	(revision f941b14c7a92d23575eccdfcd7bbb7ef127d1bad)
@@ -0,0 +1,30 @@
+/*
+ * MolecularVolumeAction.hpp
+ *
+ *  Created on: May 12, 2010
+ *      Author: heber
+ */
+
+#ifndef MOLECULARVOLUMEACTION_HPP_
+#define MOLECULARVOLUMEACTION_HPP_
+
+#include "Actions/Action.hpp"
+
+class AnalysisMolecularVolumeAction : public Action {
+public:
+  AnalysisMolecularVolumeAction();
+  virtual ~AnalysisMolecularVolumeAction();
+
+  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 /* MOLECULARVOLUMEACTION_HPP_ */
Index: src/Actions/AnalysisAction/PairCorrelationAction.cpp
===================================================================
--- src/Actions/AnalysisAction/PairCorrelationAction.cpp	(revision f941b14c7a92d23575eccdfcd7bbb7ef127d1bad)
+++ src/Actions/AnalysisAction/PairCorrelationAction.cpp	(revision f941b14c7a92d23575eccdfcd7bbb7ef127d1bad)
@@ -0,0 +1,102 @@
+/*
+ * PairCorrelationAction.cpp
+ *
+ *  Created on: May 9, 2010
+ *      Author: heber
+ */
+
+#include "Actions/AnalysisAction/PairCorrelationAction.hpp"
+#include "CommandLineParser.hpp"
+#include "analysis_correlation.hpp"
+#include "log.hpp"
+#include "element.hpp"
+#include "periodentafel.hpp"
+#include "World.hpp"
+
+#include <iostream>
+#include <string>
+
+using namespace std;
+
+#include "UIElements/UIFactory.hpp"
+#include "UIElements/Dialog.hpp"
+#include "Actions/MapOfActions.hpp"
+
+const char AnalysisPairCorrelationAction::NAME[] = "pair-correlation";
+
+AnalysisPairCorrelationAction::AnalysisPairCorrelationAction() :
+  Action(NAME)
+{}
+
+AnalysisPairCorrelationAction::~AnalysisPairCorrelationAction()
+{}
+
+Action::state_ptr AnalysisPairCorrelationAction::performCall() {
+  Dialog *dialog = UIFactory::getInstance().makeDialog();
+  int ranges[3] = {1, 1, 1};
+  double BinStart = 0.;
+  double BinEnd = 0.;
+  string outputname;
+  string binoutputname;
+  bool periodic;
+  ofstream output;
+  ofstream binoutput;
+  const element *elemental1;
+  const element *elemental2;
+
+  dialog->queryElement("elements", &elemental1, MapOfActions::getInstance().getDescription("elements"));
+  dialog->queryElement("elements", &elemental2, MapOfActions::getInstance().getDescription("elements"));
+  dialog->queryDouble("bin-start", &BinStart, MapOfActions::getInstance().getDescription("bin-start"));
+  dialog->queryDouble("bin-end", &BinEnd, MapOfActions::getInstance().getDescription("bin-end"));
+  dialog->queryString("output-file", &outputname, MapOfActions::getInstance().getDescription("output-file"));
+  dialog->queryString("bin-output-file", &binoutputname, MapOfActions::getInstance().getDescription("bin-output-file"));
+  dialog->queryBoolean("periodic", &periodic, MapOfActions::getInstance().getDescription("periodic"));
+
+  if(dialog->display()) {
+    output.open(outputname.c_str());
+    binoutput.open(binoutputname.c_str());
+    PairCorrelationMap *correlationmap = NULL;
+    if (periodic)
+      correlationmap = PeriodicPairCorrelation(World::getInstance().getMolecules(), elemental1, elemental2, ranges);
+    else
+      correlationmap = PairCorrelation(World::getInstance().getMolecules(), elemental1, elemental2);
+    //OutputCorrelationToSurface(&output, correlationmap);
+    BinPairMap *binmap = BinData( correlationmap, 0.5, BinStart, BinEnd );
+    OutputCorrelation ( &binoutput, binmap );
+    output.close();
+    binoutput.close();
+    delete(binmap);
+    delete(correlationmap);
+    delete dialog;
+    return Action::success;
+  } else {
+    delete dialog;
+    return Action::failure;
+  }
+}
+
+Action::state_ptr AnalysisPairCorrelationAction::performUndo(Action::state_ptr _state) {
+//  ParserLoadXyzState *state = assert_cast<ParserLoadXyzState*>(_state.get());
+
+  return Action::failure;
+//  string newName = state->mol->getName();
+//  state->mol->setName(state->lastName);
+//
+//  return Action::state_ptr(new ParserLoadXyzState(state->mol,newName));
+}
+
+Action::state_ptr AnalysisPairCorrelationAction::performRedo(Action::state_ptr _state){
+  return Action::failure;
+}
+
+bool AnalysisPairCorrelationAction::canUndo() {
+  return false;
+}
+
+bool AnalysisPairCorrelationAction::shouldUndo() {
+  return false;
+}
+
+const string AnalysisPairCorrelationAction::getName() {
+  return NAME;
+}
Index: src/Actions/AnalysisAction/PairCorrelationAction.hpp
===================================================================
--- src/Actions/AnalysisAction/PairCorrelationAction.hpp	(revision f941b14c7a92d23575eccdfcd7bbb7ef127d1bad)
+++ src/Actions/AnalysisAction/PairCorrelationAction.hpp	(revision f941b14c7a92d23575eccdfcd7bbb7ef127d1bad)
@@ -0,0 +1,30 @@
+/*
+ * PairCorrelationAction.hpp
+ *
+ *  Created on: May 9, 2010
+ *      Author: heber
+ */
+
+#ifndef PAIRCORRELATIONACTION_HPP_
+#define PAIRCORRELATIONACTION_HPP_
+
+#include "Actions/Action.hpp"
+
+class AnalysisPairCorrelationAction : public Action {
+public:
+  AnalysisPairCorrelationAction();
+  virtual ~AnalysisPairCorrelationAction();
+
+  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 /* PAIRCORRELATIONACTION_HPP_ */
Index: src/Actions/AnalysisAction/PairCorrelationToPointAction.cpp
===================================================================
--- src/Actions/AnalysisAction/PairCorrelationToPointAction.cpp	(revision f941b14c7a92d23575eccdfcd7bbb7ef127d1bad)
+++ src/Actions/AnalysisAction/PairCorrelationToPointAction.cpp	(revision f941b14c7a92d23575eccdfcd7bbb7ef127d1bad)
@@ -0,0 +1,103 @@
+/*
+ * PairCorrelationToPointAction.cpp
+ *
+ *  Created on: May 9, 2010
+ *      Author: heber
+ */
+
+#include "Actions/AnalysisAction/PairCorrelationToPointAction.hpp"
+#include "CommandLineParser.hpp"
+#include "analysis_correlation.hpp"
+#include "log.hpp"
+#include "element.hpp"
+#include "periodentafel.hpp"
+#include "World.hpp"
+
+#include <iostream>
+#include <string>
+
+using namespace std;
+
+#include "UIElements/UIFactory.hpp"
+#include "UIElements/Dialog.hpp"
+#include "Actions/MapOfActions.hpp"
+
+const char AnalysisPairCorrelationToPointAction::NAME[] = "pair-correlation-point";
+
+AnalysisPairCorrelationToPointAction::AnalysisPairCorrelationToPointAction() :
+  Action(NAME)
+{}
+
+AnalysisPairCorrelationToPointAction::~AnalysisPairCorrelationToPointAction()
+{}
+
+Action::state_ptr AnalysisPairCorrelationToPointAction::performCall() {
+  Dialog *dialog = UIFactory::getInstance().makeDialog();
+  int ranges[3] = {1, 1, 1};
+  Vector position;
+  double BinStart = 0.;
+  double BinEnd = 0.;
+  string outputname;
+  string binoutputname;
+  bool periodic;
+  ofstream output;
+  ofstream binoutput;
+  const element *elemental;
+
+  dialog->queryElement("elements", &elemental, MapOfActions::getInstance().getDescription("element"));
+  dialog->queryVector("position", &position, World::getInstance().getDomain(), true, MapOfActions::getInstance().getDescription("position"));
+  dialog->queryDouble("bin-start", &BinStart, MapOfActions::getInstance().getDescription("bin-start"));
+  dialog->queryDouble("bin-end", &BinEnd, MapOfActions::getInstance().getDescription("bin-end"));
+  dialog->queryString("output-file", &outputname, MapOfActions::getInstance().getDescription("output-file"));
+  dialog->queryString("bin-output-file", &binoutputname, MapOfActions::getInstance().getDescription("bin-output-file"));
+  dialog->queryBoolean("periodic", &periodic, MapOfActions::getInstance().getDescription("periodic"));
+
+  if(dialog->display()) {
+    output.open(outputname.c_str());
+    binoutput.open(binoutputname.c_str());
+    const Vector Point = position;
+    CorrelationToPointMap *correlationmap = NULL;
+    if (periodic)
+      correlationmap  = PeriodicCorrelationToPoint(World::getInstance().getMolecules(), elemental, &Point, ranges);
+    else
+      correlationmap = CorrelationToPoint(World::getInstance().getMolecules(), elemental, &Point);
+    //OutputCorrelationToSurface(&output, correlationmap);
+    BinPairMap *binmap = BinData( correlationmap, 0.5, BinStart, BinEnd );
+    OutputCorrelation ( &binoutput, binmap );
+    output.close();
+    binoutput.close();
+    delete(binmap);
+    delete(correlationmap);
+    delete dialog;
+    return Action::success;
+  } else {
+    delete dialog;
+    return Action::failure;
+  }
+}
+
+Action::state_ptr AnalysisPairCorrelationToPointAction::performUndo(Action::state_ptr _state) {
+//  ParserLoadXyzState *state = assert_cast<ParserLoadXyzState*>(_state.get());
+
+  return Action::failure;
+//  string newName = state->mol->getName();
+//  state->mol->setName(state->lastName);
+//
+//  return Action::state_ptr(new ParserLoadXyzState(state->mol,newName));
+}
+
+Action::state_ptr AnalysisPairCorrelationToPointAction::performRedo(Action::state_ptr _state){
+  return Action::failure;
+}
+
+bool AnalysisPairCorrelationToPointAction::canUndo() {
+  return false;
+}
+
+bool AnalysisPairCorrelationToPointAction::shouldUndo() {
+  return false;
+}
+
+const string AnalysisPairCorrelationToPointAction::getName() {
+  return NAME;
+}
Index: src/Actions/AnalysisAction/PairCorrelationToPointAction.hpp
===================================================================
--- src/Actions/AnalysisAction/PairCorrelationToPointAction.hpp	(revision f941b14c7a92d23575eccdfcd7bbb7ef127d1bad)
+++ src/Actions/AnalysisAction/PairCorrelationToPointAction.hpp	(revision f941b14c7a92d23575eccdfcd7bbb7ef127d1bad)
@@ -0,0 +1,30 @@
+/*
+ * PairCorrelationToPointAction.hpp
+ *
+ *  Created on: May 9, 2010
+ *      Author: heber
+ */
+
+#ifndef PAIRCORRELATIONTOPOINTACTION_HPP_
+#define PAIRCORRELATIONTOPOINTACTION_HPP_
+
+#include "Actions/Action.hpp"
+
+class AnalysisPairCorrelationToPointAction : public Action {
+public:
+  AnalysisPairCorrelationToPointAction();
+  virtual ~AnalysisPairCorrelationToPointAction();
+
+  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 /* PAIRCORRELATIONTOPOINTACTION_HPP_ */
Index: src/Actions/AnalysisAction/PairCorrelationToSurfaceAction.cpp
===================================================================
--- src/Actions/AnalysisAction/PairCorrelationToSurfaceAction.cpp	(revision f941b14c7a92d23575eccdfcd7bbb7ef127d1bad)
+++ src/Actions/AnalysisAction/PairCorrelationToSurfaceAction.cpp	(revision f941b14c7a92d23575eccdfcd7bbb7ef127d1bad)
@@ -0,0 +1,128 @@
+/*
+ * PairCorrelationToSurfaceAction.cpp
+ *
+ *  Created on: May 9, 2010
+ *      Author: heber
+ */
+
+#include "Actions/AnalysisAction/PairCorrelationToSurfaceAction.hpp"
+#include "CommandLineParser.hpp"
+#include "analysis_correlation.hpp"
+#include "boundary.hpp"
+#include "element.hpp"
+#include "linkedcell.hpp"
+#include "log.hpp"
+#include "molecule.hpp"
+#include "verbose.hpp"
+#include "World.hpp"
+
+#include <iostream>
+#include <string>
+
+using namespace std;
+
+#include "UIElements/UIFactory.hpp"
+#include "UIElements/Dialog.hpp"
+#include "Actions/MapOfActions.hpp"
+
+const char AnalysisPairCorrelationToSurfaceAction::NAME[] = "pair-correlation-surface";
+
+AnalysisPairCorrelationToSurfaceAction::AnalysisPairCorrelationToSurfaceAction() :
+  Action(NAME)
+{}
+
+AnalysisPairCorrelationToSurfaceAction::~AnalysisPairCorrelationToSurfaceAction()
+{}
+
+Action::state_ptr AnalysisPairCorrelationToSurfaceAction::performCall() {
+  Dialog *dialog = UIFactory::getInstance().makeDialog();
+  double BinStart = 0.;
+  double BinWidth = 0.;
+  double BinEnd = 0.;
+  string outputname;
+  string binoutputname;
+  bool periodic;
+  ofstream output;
+  ofstream binoutput;
+  int ranges[3] = {1, 1, 1};
+  const element *elemental = NULL;
+  molecule *Boundary = NULL;
+
+  dialog->queryElement("elements", &elemental, MapOfActions::getInstance().getDescription("element"));
+  dialog->queryMolecule("molecule-by-id", &Boundary, MapOfActions::getInstance().getDescription("molecule-by-id"));
+  dialog->queryDouble("bin-start", &BinStart, MapOfActions::getInstance().getDescription("bin-start"));
+  dialog->queryDouble("bin-end", &BinEnd, MapOfActions::getInstance().getDescription("bin-end"));
+  dialog->queryString("output-file", &outputname, MapOfActions::getInstance().getDescription("output-file"));
+  dialog->queryString("bin-output-file", &binoutputname, MapOfActions::getInstance().getDescription("bin-output-file"));
+  dialog->queryBoolean("periodic", &periodic, MapOfActions::getInstance().getDescription("periodic"));
+
+  if(dialog->display()) {
+    output.open(outputname.c_str());
+    binoutput.open(binoutputname.c_str());
+    const double radius = 4.;
+    double LCWidth = 20.;
+    if (BinEnd > 0) {
+      if (BinEnd > 2.*radius)
+          LCWidth = BinEnd;
+      else
+        LCWidth = 2.*radius;
+    }
+    class MoleculeListClass *molecules = World::getInstance().getMolecules();
+    class Tesselation *TesselStruct = NULL;
+    const LinkedCell *LCList = NULL;
+    LCList = new LinkedCell(Boundary, LCWidth);
+    FindNonConvexBorder(Boundary, TesselStruct, LCList, radius, NULL);
+    CorrelationToSurfaceMap *surfacemap = NULL;
+    if (periodic)
+      surfacemap = PeriodicCorrelationToSurface( molecules, elemental, TesselStruct, LCList, ranges);
+    else
+      surfacemap = CorrelationToSurface( molecules, elemental, TesselStruct, LCList);
+    OutputCorrelationToSurface(&output, surfacemap);
+    // check whether radius was appropriate
+    {
+      double start; double end;
+      GetMinMax( surfacemap, start, end);
+      if (LCWidth < end)
+        DoeLog(1) && (eLog()<< Verbose(1) << "Linked Cell width is smaller than the found range of values! Bins can only be correct up to: " << radius << "." << endl);
+    }
+    BinPairMap *binmap = BinData( surfacemap, BinWidth, BinStart, BinEnd );
+    OutputCorrelation ( &binoutput, binmap );
+    output.close();
+    binoutput.close();
+    delete(LCList);
+    delete(TesselStruct);
+    delete(binmap);
+    delete(surfacemap);
+    delete dialog;
+    return Action::success;
+  } else {
+    delete dialog;
+    return Action::failure;
+  }
+}
+
+Action::state_ptr AnalysisPairCorrelationToSurfaceAction::performUndo(Action::state_ptr _state) {
+//  ParserLoadXyzState *state = assert_cast<ParserLoadXyzState*>(_state.get());
+
+  return Action::failure;
+//  string newName = state->mol->getName();
+//  state->mol->setName(state->lastName);
+//
+//  return Action::state_ptr(new ParserLoadXyzState(state->mol,newName));
+}
+
+Action::state_ptr AnalysisPairCorrelationToSurfaceAction::performRedo(Action::state_ptr _state){
+  return Action::failure;
+}
+
+bool AnalysisPairCorrelationToSurfaceAction::canUndo() {
+  return false;
+}
+
+bool AnalysisPairCorrelationToSurfaceAction::shouldUndo() {
+  return false;
+}
+
+const string AnalysisPairCorrelationToSurfaceAction::getName() {
+  return NAME;
+}
Index: src/Actions/AnalysisAction/PairCorrelationToSurfaceAction.hpp
===================================================================
--- src/Actions/AnalysisAction/PairCorrelationToSurfaceAction.hpp	(revision f941b14c7a92d23575eccdfcd7bbb7ef127d1bad)
+++ src/Actions/AnalysisAction/PairCorrelationToSurfaceAction.hpp	(revision f941b14c7a92d23575eccdfcd7bbb7ef127d1bad)
@@ -0,0 +1,30 @@
+/*
+ * PairCorrelationToSurfaceAction.hpp
+ *
+ *  Created on: May 9, 2010
+ *      Author: heber
+ */
+
+#ifndef PAIRCORRELATIONTOSURFACEACTION_HPP_
+#define PAIRCORRELATIONTOSURFACEACTION_HPP_
+
+#include "Actions/Action.hpp"
+
+class AnalysisPairCorrelationToSurfaceAction : public Action {
+public:
+  AnalysisPairCorrelationToSurfaceAction();
+  virtual ~AnalysisPairCorrelationToSurfaceAction();
+
+  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 /* PAIRCORRELATIONTOSURFACEACTION_HPP_ */
Index: src/Actions/AnalysisAction/PrincipalAxisSystemAction.cpp
===================================================================
--- src/Actions/AnalysisAction/PrincipalAxisSystemAction.cpp	(revision f941b14c7a92d23575eccdfcd7bbb7ef127d1bad)
+++ src/Actions/AnalysisAction/PrincipalAxisSystemAction.cpp	(revision f941b14c7a92d23575eccdfcd7bbb7ef127d1bad)
@@ -0,0 +1,73 @@
+/*
+ * PrincipalAxisSystemAction.cpp
+ *
+ *  Created on: May 12, 2010
+ *      Author: heber
+ */
+
+#include "Actions/AnalysisAction/PrincipalAxisSystemAction.hpp"
+#include "CommandLineParser.hpp"
+#include "molecule.hpp"
+#include "log.hpp"
+#include "verbose.hpp"
+
+#include <iostream>
+#include <string>
+
+using namespace std;
+
+#include "UIElements/UIFactory.hpp"
+#include "UIElements/Dialog.hpp"
+#include "Actions/MapOfActions.hpp"
+
+const char AnalysisPrincipalAxisSystemAction::NAME[] = "principal-axis-system";
+
+AnalysisPrincipalAxisSystemAction::AnalysisPrincipalAxisSystemAction() :
+  Action(NAME)
+{}
+
+AnalysisPrincipalAxisSystemAction::~AnalysisPrincipalAxisSystemAction()
+{}
+
+Action::state_ptr AnalysisPrincipalAxisSystemAction::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) << "Evaluating prinicipal axis." << endl);
+    mol->PrincipalAxisSystem(false);
+    delete dialog;
+    return Action::success;
+  } else {
+    delete dialog;
+    return Action::failure;
+  }
+}
+
+Action::state_ptr AnalysisPrincipalAxisSystemAction::performUndo(Action::state_ptr _state) {
+//  ParserLoadXyzState *state = assert_cast<ParserLoadXyzState*>(_state.get());
+
+  return Action::failure;
+//  string newName = state->mol->getName();
+//  state->mol->setName(state->lastName);
+//
+//  return Action::state_ptr(new ParserLoadXyzState(state->mol,newName));
+}
+
+Action::state_ptr AnalysisPrincipalAxisSystemAction::performRedo(Action::state_ptr _state){
+  return Action::failure;
+}
+
+bool AnalysisPrincipalAxisSystemAction::canUndo() {
+  return false;
+}
+
+bool AnalysisPrincipalAxisSystemAction::shouldUndo() {
+  return false;
+}
+
+const string AnalysisPrincipalAxisSystemAction::getName() {
+  return NAME;
+}
Index: src/Actions/AnalysisAction/PrincipalAxisSystemAction.hpp
===================================================================
--- src/Actions/AnalysisAction/PrincipalAxisSystemAction.hpp	(revision f941b14c7a92d23575eccdfcd7bbb7ef127d1bad)
+++ src/Actions/AnalysisAction/PrincipalAxisSystemAction.hpp	(revision f941b14c7a92d23575eccdfcd7bbb7ef127d1bad)
@@ -0,0 +1,30 @@
+/*
+ * PrincipalAxisSystemAction.hpp
+ *
+ *  Created on: May 12, 2010
+ *      Author: heber
+ */
+
+#ifndef PRINCIPALAXISSYSTEMACTION_HPP_
+#define PRINCIPALAXISSYSTEMACTION_HPP_
+
+#include "Actions/Action.hpp"
+
+class AnalysisPrincipalAxisSystemAction : public Action {
+public:
+  AnalysisPrincipalAxisSystemAction();
+  virtual ~AnalysisPrincipalAxisSystemAction();
+
+  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 /* PRINCIPALAXISSYSTEMACTION_HPP_ */
Index: src/Actions/AtomAction/AddAction.cpp
===================================================================
--- src/Actions/AtomAction/AddAction.cpp	(revision f941b14c7a92d23575eccdfcd7bbb7ef127d1bad)
+++ src/Actions/AtomAction/AddAction.cpp	(revision f941b14c7a92d23575eccdfcd7bbb7ef127d1bad)
@@ -0,0 +1,88 @@
+/*
+ * AddAction.cpp
+ *
+ *  Created on: May 9, 2010
+ *      Author: heber
+ */
+
+#include "Actions/AtomAction/AddAction.hpp"
+#include "CommandLineParser.hpp"
+#include "atom.hpp"
+#include "element.hpp"
+#include "log.hpp"
+#include "periodentafel.hpp"
+#include "vector.hpp"
+#include "verbose.hpp"
+#include "World.hpp"
+
+#include <iostream>
+#include <string>
+
+using namespace std;
+
+#include "UIElements/UIFactory.hpp"
+#include "UIElements/Dialog.hpp"
+#include "Actions/MapOfActions.hpp"
+
+const char AtomAddAction::NAME[] = "add-atom";
+
+AtomAddAction::AtomAddAction() :
+  Action(NAME)
+{}
+
+AtomAddAction::~AtomAddAction()
+{}
+
+Action::state_ptr AtomAddAction::performCall() {
+  Dialog *dialog = UIFactory::getInstance().makeDialog();
+  int Z = -1;
+  Vector position;
+
+  dialog->queryInt(NAME, &Z, MapOfActions::getInstance().getDescription(NAME));
+  dialog->queryVector("position", &position, World::getInstance().getDomain(), true, MapOfActions::getInstance().getDescription("position"));
+
+  if(dialog->display()) {
+    delete dialog;
+    atom * first = World::getInstance().createAtom();
+    first->type = World::getInstance().getPeriode()->FindElement(Z);
+    first->x = position;
+    if (first->type != NULL) {
+      DoLog(1) && (Log() << Verbose(1) << "Adding new atom with element " << first->type->name << " at " << (first->x) << "." << endl);
+      return Action::success;
+    } else {
+      DoeLog(1) && (eLog()<< Verbose(1) << "Could not find the specified element." << endl);
+      World::getInstance().destroyAtom(first);
+      return Action::failure;
+    }
+  } else {
+    delete dialog;
+    return Action::failure;
+  }
+
+}
+
+Action::state_ptr AtomAddAction::performUndo(Action::state_ptr _state) {
+//  ParserLoadXyzState *state = assert_cast<ParserLoadXyzState*>(_state.get());
+
+  return Action::failure;
+//  string newName = state->mol->getName();
+//  state->mol->setName(state->lastName);
+//
+//  return Action::state_ptr(new ParserLoadXyzState(state->mol,newName));
+}
+
+Action::state_ptr AtomAddAction::performRedo(Action::state_ptr _state){
+  return Action::failure;
+}
+
+bool AtomAddAction::canUndo() {
+  return false;
+}
+
+bool AtomAddAction::shouldUndo() {
+  return false;
+}
+
+const string AtomAddAction::getName() {
+  return NAME;
+}
Index: src/Actions/AtomAction/AddAction.hpp
===================================================================
--- src/Actions/AtomAction/AddAction.hpp	(revision f941b14c7a92d23575eccdfcd7bbb7ef127d1bad)
+++ src/Actions/AtomAction/AddAction.hpp	(revision f941b14c7a92d23575eccdfcd7bbb7ef127d1bad)
@@ -0,0 +1,30 @@
+/*
+ * AddAction.hpp
+ *
+ *  Created on: May 9, 2010
+ *      Author: heber
+ */
+
+#ifndef ADDACTION_HPP_
+#define ADDACTION_HPP_
+
+#include "Actions/Action.hpp"
+
+class AtomAddAction : public Action {
+public:
+  AtomAddAction();
+  virtual ~AtomAddAction();
+
+  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 /* ADDACTION_HPP_ */
Index: src/Actions/AtomAction/ChangeElementAction.cpp
===================================================================
--- src/Actions/AtomAction/ChangeElementAction.cpp	(revision f941b14c7a92d23575eccdfcd7bbb7ef127d1bad)
+++ src/Actions/AtomAction/ChangeElementAction.cpp	(revision f941b14c7a92d23575eccdfcd7bbb7ef127d1bad)
@@ -0,0 +1,82 @@
+/*
+ * ChangeElementAction.cpp
+ *
+ *  Created on: May 9, 2010
+ *      Author: heber
+ */
+
+#include "Actions/AtomAction/ChangeElementAction.hpp"
+#include "CommandLineParser.hpp"
+#include "atom.hpp"
+#include "log.hpp"
+#include "vector.hpp"
+#include "verbose.hpp"
+#include "World.hpp"
+
+#include <iostream>
+#include <string>
+
+using namespace std;
+
+#include "UIElements/UIFactory.hpp"
+#include "UIElements/Dialog.hpp"
+#include "Actions/MapOfActions.hpp"
+
+const char AtomChangeElementAction::NAME[] = "change-element";
+
+AtomChangeElementAction::AtomChangeElementAction() :
+  Action(NAME)
+{}
+
+AtomChangeElementAction::~AtomChangeElementAction()
+{}
+
+Action::state_ptr AtomChangeElementAction::performCall() {
+  Dialog *dialog = UIFactory::getInstance().makeDialog();
+  int Z = -1;
+  atom *first = NULL;
+  element *elemental = NULL;
+
+  dialog->queryElement(NAME, (const element **) &elemental, MapOfActions::getInstance().getDescription(NAME));
+  dialog->queryAtom("atom-by-id", &first, MapOfActions::getInstance().getDescription("atom-by-id"));
+
+  if(dialog->display()) {
+    delete dialog;
+    DoLog(1) && (Log() << Verbose(1) << "Changing atom " << *first << " to element " << elemental << "." << endl);
+    if (elemental != NULL) {
+      first->type = elemental;
+      return Action::success;
+    } else
+      return Action::failure;
+  } else {
+    delete dialog;
+    return Action::failure;
+  }
+
+}
+
+Action::state_ptr AtomChangeElementAction::performUndo(Action::state_ptr _state) {
+//  ParserLoadXyzState *state = assert_cast<ParserLoadXyzState*>(_state.get());
+
+  return Action::failure;
+//  string newName = state->mol->getName();
+//  state->mol->setName(state->lastName);
+//
+//  return Action::state_ptr(new ParserLoadXyzState(state->mol,newName));
+}
+
+Action::state_ptr AtomChangeElementAction::performRedo(Action::state_ptr _state){
+  return Action::failure;
+}
+
+bool AtomChangeElementAction::canUndo() {
+  return false;
+}
+
+bool AtomChangeElementAction::shouldUndo() {
+  return false;
+}
+
+const string AtomChangeElementAction::getName() {
+  return NAME;
+}
Index: src/Actions/AtomAction/ChangeElementAction.hpp
===================================================================
--- src/Actions/AtomAction/ChangeElementAction.hpp	(revision f941b14c7a92d23575eccdfcd7bbb7ef127d1bad)
+++ src/Actions/AtomAction/ChangeElementAction.hpp	(revision f941b14c7a92d23575eccdfcd7bbb7ef127d1bad)
@@ -0,0 +1,30 @@
+/*
+ * ChangeElementAction.hpp
+ *
+ *  Created on: May 9, 2010
+ *      Author: heber
+ */
+
+#ifndef CHANGELEMENTACTION_HPP_
+#define CHANGELEMENTACTION_HPP_
+
+#include "Actions/Action.hpp"
+
+class AtomChangeElementAction : public Action {
+public:
+  AtomChangeElementAction();
+  virtual ~AtomChangeElementAction();
+
+  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 /* CHANGELEMENTACTION_HPP_ */
Index: src/Actions/AtomAction/RemoveAction.cpp
===================================================================
--- src/Actions/AtomAction/RemoveAction.cpp	(revision f941b14c7a92d23575eccdfcd7bbb7ef127d1bad)
+++ src/Actions/AtomAction/RemoveAction.cpp	(revision f941b14c7a92d23575eccdfcd7bbb7ef127d1bad)
@@ -0,0 +1,76 @@
+/*
+ * RemoveAction.cpp
+ *
+ *  Created on: May 9, 2010
+ *      Author: heber
+ */
+
+#include "Actions/AtomAction/RemoveAction.hpp"
+#include "CommandLineParser.hpp"
+#include "atom.hpp"
+#include "Descriptors/AtomDescriptor.hpp"
+#include "log.hpp"
+#include "verbose.hpp"
+#include "World.hpp"
+
+#include <iostream>
+#include <string>
+
+using namespace std;
+
+#include "UIElements/UIFactory.hpp"
+#include "UIElements/Dialog.hpp"
+#include "Actions/MapOfActions.hpp"
+
+const char AtomRemoveAction::NAME[] = "remove-atom";
+
+AtomRemoveAction::AtomRemoveAction() :
+  Action(NAME)
+{}
+
+AtomRemoveAction::~AtomRemoveAction()
+{}
+
+Action::state_ptr AtomRemoveAction::performCall() {
+  Dialog *dialog = UIFactory::getInstance().makeDialog();
+  atom *first = NULL;
+
+  dialog->queryAtom(NAME, &first, MapOfActions::getInstance().getDescription(NAME));
+
+  if(dialog->display()) {
+    delete dialog;
+    DoLog(1) && (Log() << Verbose(1) << "Removing atom " << first->getId() << "." << endl);
+    World::getInstance().destroyAtom(first);
+    return Action::success;
+  } else {
+    delete dialog;
+    return Action::failure;
+  }
+
+}
+
+Action::state_ptr AtomRemoveAction::performUndo(Action::state_ptr _state) {
+//  ParserLoadXyzState *state = assert_cast<ParserLoadXyzState*>(_state.get());
+
+  return Action::failure;
+//  string newName = state->mol->getName();
+//  state->mol->setName(state->lastName);
+//
+//  return Action::state_ptr(new ParserLoadXyzState(state->mol,newName));
+}
+
+Action::state_ptr AtomRemoveAction::performRedo(Action::state_ptr _state){
+  return Action::failure;
+}
+
+bool AtomRemoveAction::canUndo() {
+  return false;
+}
+
+bool AtomRemoveAction::shouldUndo() {
+  return false;
+}
+
+const string AtomRemoveAction::getName() {
+  return NAME;
+}
Index: src/Actions/AtomAction/RemoveAction.hpp
===================================================================
--- src/Actions/AtomAction/RemoveAction.hpp	(revision f941b14c7a92d23575eccdfcd7bbb7ef127d1bad)
+++ src/Actions/AtomAction/RemoveAction.hpp	(revision f941b14c7a92d23575eccdfcd7bbb7ef127d1bad)
@@ -0,0 +1,30 @@
+/*
+ * RemoveAction.hpp
+ *
+ *  Created on: May 9, 2010
+ *      Author: heber
+ */
+
+#ifndef REMOVEACTION_HPP_
+#define REMOVEACTION_HPP_
+
+#include "Actions/Action.hpp"
+
+class AtomRemoveAction : public Action {
+public:
+  AtomRemoveAction();
+  virtual ~AtomRemoveAction();
+
+  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 /* REMOVEACTION_HPP_ */
Index: src/Actions/CmdAction/BondLengthTableAction.cpp
===================================================================
--- src/Actions/CmdAction/BondLengthTableAction.cpp	(revision f941b14c7a92d23575eccdfcd7bbb7ef127d1bad)
+++ src/Actions/CmdAction/BondLengthTableAction.cpp	(revision f941b14c7a92d23575eccdfcd7bbb7ef127d1bad)
@@ -0,0 +1,86 @@
+/*
+ * BondLengthTableAction.cpp
+ *
+ *  Created on: May 9, 2010
+ *      Author: heber
+ */
+
+#include "Actions/CmdAction/BondLengthTableAction.hpp"
+#include "CommandLineParser.hpp"
+#include "config.hpp"
+#include "log.hpp"
+#include "verbose.hpp"
+#include "World.hpp"
+
+#include <iostream>
+#include <string>
+
+using namespace std;
+
+#include "UIElements/UIFactory.hpp"
+#include "UIElements/Dialog.hpp"
+#include "Actions/MapOfActions.hpp"
+
+const char CommandLineBondLengthTableAction::NAME[] = "bond-table";
+
+CommandLineBondLengthTableAction::CommandLineBondLengthTableAction() :
+  Action(NAME)
+{}
+
+CommandLineBondLengthTableAction::~CommandLineBondLengthTableAction()
+{}
+
+Action::state_ptr CommandLineBondLengthTableAction::performCall() {
+  ostringstream usage;
+  string BondGraphFileName;
+  Dialog *dialog = UIFactory::getInstance().makeDialog();
+
+  config *configuration = World::getInstance().getConfig();
+  dialog->queryString(NAME, &BondGraphFileName, MapOfActions::getInstance().getDescription(NAME));
+
+  if(dialog->display()) {
+    delete dialog;
+  } else {
+    delete dialog;
+  }
+
+  if (configuration->BG == NULL) {
+    configuration->BG = new BondGraph(configuration->GetIsAngstroem());
+    if ((!BondGraphFileName.empty()) && (configuration->BG->LoadBondLengthTable(BondGraphFileName))) {
+      DoLog(0) && (Log() << Verbose(0) << "Bond length table loaded successfully." << endl);
+      return Action::success;
+    } else {
+      DoeLog(1) && (eLog()<< Verbose(1) << "Bond length table loading failed." << endl);
+      return Action::failure;
+    }
+  } else {
+    DoLog(0) && (Log() << Verbose(0) << "Bond length table already present." << endl);
+    return Action::failure;
+  }
+}
+
+Action::state_ptr CommandLineBondLengthTableAction::performUndo(Action::state_ptr _state) {
+//  ParserLoadXyzState *state = assert_cast<ParserLoadXyzState*>(_state.get());
+
+  return Action::failure;
+//  string newName = state->mol->getName();
+//  state->mol->setName(state->lastName);
+//
+//  return Action::state_ptr(new ParserLoadXyzState(state->mol,newName));
+}
+
+Action::state_ptr CommandLineBondLengthTableAction::performRedo(Action::state_ptr _state){
+  return Action::failure;
+}
+
+bool CommandLineBondLengthTableAction::canUndo() {
+  return false;
+}
+
+bool CommandLineBondLengthTableAction::shouldUndo() {
+  return false;
+}
+
+const string CommandLineBondLengthTableAction::getName() {
+  return NAME;
+}
Index: src/Actions/CmdAction/BondLengthTableAction.hpp
===================================================================
--- src/Actions/CmdAction/BondLengthTableAction.hpp	(revision f941b14c7a92d23575eccdfcd7bbb7ef127d1bad)
+++ src/Actions/CmdAction/BondLengthTableAction.hpp	(revision f941b14c7a92d23575eccdfcd7bbb7ef127d1bad)
@@ -0,0 +1,30 @@
+/*
+ * BondLengthTableAction.hpp
+ *
+ *  Created on: May 9, 2010
+ *      Author: heber
+ */
+
+#ifndef BONDLENGTHTABLEACTION_HPP_
+#define BONDLENGTHTABLEACTION_HPP_
+
+#include "Actions/Action.hpp"
+
+class CommandLineBondLengthTableAction : public Action {
+public:
+  CommandLineBondLengthTableAction();
+  virtual ~CommandLineBondLengthTableAction();
+
+  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 /* BONDLENGTHTABLEACTION_HPP_ */
Index: src/Actions/CmdAction/ElementDbAction.cpp
===================================================================
--- src/Actions/CmdAction/ElementDbAction.cpp	(revision f941b14c7a92d23575eccdfcd7bbb7ef127d1bad)
+++ src/Actions/CmdAction/ElementDbAction.cpp	(revision f941b14c7a92d23575eccdfcd7bbb7ef127d1bad)
@@ -0,0 +1,88 @@
+/*
+ * ElementDbAction.cpp
+ *
+ *  Created on: May 9, 2010
+ *      Author: heber
+ */
+
+#include "Actions/CmdAction/ElementDbAction.hpp"
+#include "CommandLineParser.hpp"
+#include "config.hpp"
+#include "log.hpp"
+#include "periodentafel.hpp"
+#include "verbose.hpp"
+#include "World.hpp"
+
+#include <iostream>
+#include <string>
+
+using namespace std;
+
+#include "UIElements/UIFactory.hpp"
+#include "UIElements/Dialog.hpp"
+#include "Actions/MapOfActions.hpp"
+
+const char CommandLineElementDbAction::NAME[] = "element-db";
+
+CommandLineElementDbAction::CommandLineElementDbAction() :
+  Action(NAME)
+{}
+
+CommandLineElementDbAction::~CommandLineElementDbAction()
+{}
+
+Action::state_ptr CommandLineElementDbAction::performCall() {
+  ostringstream usage;
+  string databasepath;
+  Dialog *dialog = UIFactory::getInstance().makeDialog();
+
+  // get the path
+  // TODO: Make databasepath a std::string
+  config *configuration = World::getInstance().getConfig();
+  dialog->queryString(NAME, &databasepath, MapOfActions::getInstance().getDescription(NAME));
+  strcpy(configuration->databasepath, databasepath.c_str());
+
+  if(dialog->display()) {
+    delete dialog;
+  } else {
+    delete dialog;
+  }
+
+  // load table
+  periodentafel *periode = World::getInstance().getPeriode();
+  if (periode->LoadPeriodentafel(configuration->databasepath)) {
+    DoLog(0) && (Log() << Verbose(0) << "Element list loaded successfully." << endl);
+    //periode->Output();
+    return Action::success;
+  } else {
+    DoLog(0) && (Log() << Verbose(0) << "Element list loading failed." << endl);
+    return Action::failure;
+  }
+
+}
+
+Action::state_ptr CommandLineElementDbAction::performUndo(Action::state_ptr _state) {
+//  ParserLoadXyzState *state = assert_cast<ParserLoadXyzState*>(_state.get());
+
+  return Action::failure;
+//  string newName = state->mol->getName();
+//  state->mol->setName(state->lastName);
+//
+//  return Action::state_ptr(new ParserLoadXyzState(state->mol,newName));
+}
+
+Action::state_ptr CommandLineElementDbAction::performRedo(Action::state_ptr _state){
+  return Action::failure;
+}
+
+bool CommandLineElementDbAction::canUndo() {
+  return false;
+}
+
+bool CommandLineElementDbAction::shouldUndo() {
+  return false;
+}
+
+const string CommandLineElementDbAction::getName() {
+  return NAME;
+}
Index: src/Actions/CmdAction/ElementDbAction.hpp
===================================================================
--- src/Actions/CmdAction/ElementDbAction.hpp	(revision f941b14c7a92d23575eccdfcd7bbb7ef127d1bad)
+++ src/Actions/CmdAction/ElementDbAction.hpp	(revision f941b14c7a92d23575eccdfcd7bbb7ef127d1bad)
@@ -0,0 +1,30 @@
+/*
+ * ElementDbAction.hpp
+ *
+ *  Created on: May 9, 2010
+ *      Author: heber
+ */
+
+#ifndef ELEMENTDBACTION_HPP_
+#define ELEMENTDBACTION_HPP_
+
+#include "Actions/Action.hpp"
+
+class CommandLineElementDbAction : public Action {
+public:
+  CommandLineElementDbAction();
+  virtual ~CommandLineElementDbAction();
+
+  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 /* ELEMENTDBACTION_HPP_ */
Index: src/Actions/CmdAction/FastParsingAction.cpp
===================================================================
--- src/Actions/CmdAction/FastParsingAction.cpp	(revision f941b14c7a92d23575eccdfcd7bbb7ef127d1bad)
+++ src/Actions/CmdAction/FastParsingAction.cpp	(revision f941b14c7a92d23575eccdfcd7bbb7ef127d1bad)
@@ -0,0 +1,76 @@
+/*
+ * FastParsingAction.cpp
+ *
+ *  Created on: May 9, 2010
+ *      Author: heber
+ */
+
+#include "Actions/CmdAction/FastParsingAction.hpp"
+#include "CommandLineParser.hpp"
+#include "config.hpp"
+#include "log.hpp"
+#include "verbose.hpp"
+#include "World.hpp"
+
+#include <iostream>
+#include <string>
+
+using namespace std;
+
+#include "UIElements/UIFactory.hpp"
+#include "UIElements/Dialog.hpp"
+#include "Actions/MapOfActions.hpp"
+
+const char CommandLineFastParsingAction::NAME[] = "fastparsing";
+
+CommandLineFastParsingAction::CommandLineFastParsingAction() :
+  Action(NAME)
+{}
+
+CommandLineFastParsingAction::~CommandLineFastParsingAction()
+{}
+
+Action::state_ptr CommandLineFastParsingAction::performCall() {
+  Dialog *dialog = UIFactory::getInstance().makeDialog();
+
+  config *configuration = World::getInstance().getConfig();
+  dialog->queryBoolean(NAME, &configuration->FastParsing, MapOfActions::getInstance().getDescription(NAME));
+
+  if(dialog->display()) {
+    if (configuration->FastParsing)
+      DoLog(0) && (Log() << Verbose(0) << "I won't parse trajectories." << endl);
+    else
+      DoLog(0) && (Log() << Verbose(0) << "I will parse trajectories." << endl);
+    delete dialog;
+    return Action::success;
+  } else {
+    delete dialog;
+    return Action::failure;
+  }
+}
+
+Action::state_ptr CommandLineFastParsingAction::performUndo(Action::state_ptr _state) {
+//  ParserLoadXyzState *state = assert_cast<ParserLoadXyzState*>(_state.get());
+
+  return Action::failure;
+//  string newName = state->mol->getName();
+//  state->mol->setName(state->lastName);
+//
+//  return Action::state_ptr(new ParserLoadXyzState(state->mol,newName));
+}
+
+Action::state_ptr CommandLineFastParsingAction::performRedo(Action::state_ptr _state){
+  return Action::failure;
+}
+
+bool CommandLineFastParsingAction::canUndo() {
+  return false;
+}
+
+bool CommandLineFastParsingAction::shouldUndo() {
+  return false;
+}
+
+const string CommandLineFastParsingAction::getName() {
+  return NAME;
+}
Index: src/Actions/CmdAction/FastParsingAction.hpp
===================================================================
--- src/Actions/CmdAction/FastParsingAction.hpp	(revision f941b14c7a92d23575eccdfcd7bbb7ef127d1bad)
+++ src/Actions/CmdAction/FastParsingAction.hpp	(revision f941b14c7a92d23575eccdfcd7bbb7ef127d1bad)
@@ -0,0 +1,30 @@
+/*
+ * FastParsingAction.hpp
+ *
+ *  Created on: May 9, 2010
+ *      Author: heber
+ */
+
+#ifndef FASTPARSINGACTION_HPP_
+#define FASTPARSINGACTION_HPP_
+
+#include "Actions/Action.hpp"
+
+class CommandLineFastParsingAction : public Action {
+public:
+  CommandLineFastParsingAction();
+  virtual ~CommandLineFastParsingAction();
+
+  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 /* FASTPARSINGACTION_HPP_ */
Index: src/Actions/CmdAction/HelpAction.cpp
===================================================================
--- src/Actions/CmdAction/HelpAction.cpp	(revision f941b14c7a92d23575eccdfcd7bbb7ef127d1bad)
+++ src/Actions/CmdAction/HelpAction.cpp	(revision f941b14c7a92d23575eccdfcd7bbb7ef127d1bad)
@@ -0,0 +1,69 @@
+/*
+ * HelpAction.cpp
+ *
+ *  Created on: May 8, 2010
+ *      Author: heber
+ */
+
+#include "Actions/CmdAction/HelpAction.hpp"
+#include "CommandLineParser.hpp"
+
+#include <iostream>
+#include <string>
+
+using namespace std;
+
+#include "UIElements/UIFactory.hpp"
+#include "UIElements/Dialog.hpp"
+#include "Actions/MapOfActions.hpp"
+
+const char CommandLineHelpAction::NAME[] = "help";
+
+CommandLineHelpAction::CommandLineHelpAction() :
+  Action(NAME)
+{}
+
+CommandLineHelpAction::~CommandLineHelpAction()
+{}
+
+Action::state_ptr CommandLineHelpAction::performCall() {
+  ostringstream usage;
+  Dialog *dialog = UIFactory::getInstance().makeDialog();
+
+  usage << CommandLineParser::getInstance().visible << endl;
+  dialog->queryEmpty(NAME, usage.str());
+
+  if(dialog->display()) {
+    delete dialog;
+    return Action::success;
+  } else {
+    delete dialog;
+    return Action::failure;
+  }
+}
+
+Action::state_ptr CommandLineHelpAction::performUndo(Action::state_ptr _state) {
+//  ParserLoadXyzState *state = assert_cast<ParserLoadXyzState*>(_state.get());
+
+  return Action::failure;
+//  string newName = state->mol->getName();
+//  state->mol->setName(state->lastName);
+//
+//  return Action::state_ptr(new ParserLoadXyzState(state->mol,newName));
+}
+
+Action::state_ptr CommandLineHelpAction::performRedo(Action::state_ptr _state){
+  return Action::failure;
+}
+
+bool CommandLineHelpAction::canUndo() {
+  return false;
+}
+
+bool CommandLineHelpAction::shouldUndo() {
+  return false;
+}
+
+const string CommandLineHelpAction::getName() {
+  return NAME;
+}
Index: src/Actions/CmdAction/HelpAction.hpp
===================================================================
--- src/Actions/CmdAction/HelpAction.hpp	(revision f941b14c7a92d23575eccdfcd7bbb7ef127d1bad)
+++ src/Actions/CmdAction/HelpAction.hpp	(revision f941b14c7a92d23575eccdfcd7bbb7ef127d1bad)
@@ -0,0 +1,30 @@
+/*
+ * HelpAction.hpp
+ *
+ *  Created on: May 8, 2010
+ *      Author: heber
+ */
+
+#ifndef HELPACTION_HPP_
+#define HELPACTION_HPP_
+
+#include "Actions/Action.hpp"
+
+class CommandLineHelpAction : public Action {
+public:
+  CommandLineHelpAction();
+  virtual ~CommandLineHelpAction();
+
+  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 /* HELPACTION_HPP_ */
Index: src/Actions/CmdAction/VerboseAction.cpp
===================================================================
--- src/Actions/CmdAction/VerboseAction.cpp	(revision f941b14c7a92d23575eccdfcd7bbb7ef127d1bad)
+++ src/Actions/CmdAction/VerboseAction.cpp	(revision f941b14c7a92d23575eccdfcd7bbb7ef127d1bad)
@@ -0,0 +1,72 @@
+/*
+ * VerboseAction.cpp
+ *
+ *  Created on: May 9, 2010
+ *      Author: heber
+ */
+
+#include "Actions/CmdAction/VerboseAction.hpp"
+#include "CommandLineParser.hpp"
+#include "log.hpp"
+#include "verbose.hpp"
+
+#include <iostream>
+#include <string>
+
+using namespace std;
+
+#include "UIElements/UIFactory.hpp"
+#include "UIElements/Dialog.hpp"
+#include "Actions/MapOfActions.hpp"
+
+const char CommandLineVerboseAction::NAME[] = "verbose";
+
+CommandLineVerboseAction::CommandLineVerboseAction() :
+  Action(NAME)
+{}
+
+CommandLineVerboseAction::~CommandLineVerboseAction()
+{}
+
+Action::state_ptr CommandLineVerboseAction::performCall() {
+  Dialog *dialog = UIFactory::getInstance().makeDialog();
+  int verbosity = 2;
+
+  dialog->queryInt(NAME, &verbosity, MapOfActions::getInstance().getDescription(NAME));
+
+  if(dialog->display()) {
+    setVerbosity(verbosity);
+    DoLog(0) && (Log() << Verbose(0) << "Setting verbosity to " << verbosity << "." << endl);
+    delete dialog;
+    return Action::success;
+  } else {
+    delete dialog;
+    return Action::failure;
+  }
+}
+
+Action::state_ptr CommandLineVerboseAction::performUndo(Action::state_ptr _state) {
+//  ParserLoadXyzState *state = assert_cast<ParserLoadXyzState*>(_state.get());
+
+  return Action::failure;
+//  string newName = state->mol->getName();
+//  state->mol->setName(state->lastName);
+//
+//  return Action::state_ptr(new ParserLoadXyzState(state->mol,newName));
+}
+
+Action::state_ptr CommandLineVerboseAction::performRedo(Action::state_ptr _state){
+  return Action::failure;
+}
+
+bool CommandLineVerboseAction::canUndo() {
+  return false;
+}
+
+bool CommandLineVerboseAction::shouldUndo() {
+  return false;
+}
+
+const string CommandLineVerboseAction::getName() {
+  return NAME;
+}
Index: src/Actions/CmdAction/VerboseAction.hpp
===================================================================
--- src/Actions/CmdAction/VerboseAction.hpp	(revision f941b14c7a92d23575eccdfcd7bbb7ef127d1bad)
+++ src/Actions/CmdAction/VerboseAction.hpp	(revision f941b14c7a92d23575eccdfcd7bbb7ef127d1bad)
@@ -0,0 +1,30 @@
+/*
+ * VerboseAction.hpp
+ *
+ *  Created on: May 9, 2010
+ *      Author: heber
+ */
+
+#ifndef VERBOSEACTION_HPP_
+#define VERBOSEACTION_HPP_
+
+#include "Actions/Action.hpp"
+
+class CommandLineVerboseAction : public Action {
+public:
+  CommandLineVerboseAction();
+  virtual ~CommandLineVerboseAction();
+
+  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 /* VERBOSEACTION_HPP_ */
Index: src/Actions/CmdAction/VersionAction.cpp
===================================================================
--- src/Actions/CmdAction/VersionAction.cpp	(revision f941b14c7a92d23575eccdfcd7bbb7ef127d1bad)
+++ src/Actions/CmdAction/VersionAction.cpp	(revision f941b14c7a92d23575eccdfcd7bbb7ef127d1bad)
@@ -0,0 +1,67 @@
+/*
+ * VersionAction.cpp
+ *
+ *  Created on: May 8, 2010
+ *      Author: heber
+ */
+
+#include "Actions/CmdAction/VersionAction.hpp"
+#include "CommandLineParser.hpp"
+
+#include <iostream>
+#include <string>
+
+using namespace std;
+
+#include "UIElements/UIFactory.hpp"
+#include "UIElements/Dialog.hpp"
+#include "Actions/MapOfActions.hpp"
+
+const char CommandLineVersionAction::NAME[] = "version";
+
+CommandLineVersionAction::CommandLineVersionAction() :
+  Action(NAME)
+{}
+
+CommandLineVersionAction::~CommandLineVersionAction()
+{}
+
+Action::state_ptr CommandLineVersionAction::performCall() {
+  Dialog *dialog = UIFactory::getInstance().makeDialog();
+
+  dialog->queryEmpty(NAME, ESPACKVersion);
+
+  if(dialog->display()) {
+    delete dialog;
+    return Action::success;
+  } else {
+    delete dialog;
+    return Action::failure;
+  }
+}
+
+Action::state_ptr CommandLineVersionAction::performUndo(Action::state_ptr _state) {
+//  ParserLoadXyzState *state = assert_cast<ParserLoadXyzState*>(_state.get());
+
+  return Action::failure;
+//  string newName = state->mol->getName();
+//  state->mol->setName(state->lastName);
+//
+//  return Action::state_ptr(new ParserLoadXyzState(state->mol,newName));
+}
+
+Action::state_ptr CommandLineVersionAction::performRedo(Action::state_ptr _state){
+  return Action::failure;
+}
+
+bool CommandLineVersionAction::canUndo() {
+  return false;
+}
+
+bool CommandLineVersionAction::shouldUndo() {
+  return false;
+}
+
+const string CommandLineVersionAction::getName() {
+  return NAME;
+}
Index: src/Actions/CmdAction/VersionAction.hpp
===================================================================
--- src/Actions/CmdAction/VersionAction.hpp	(revision f941b14c7a92d23575eccdfcd7bbb7ef127d1bad)
+++ src/Actions/CmdAction/VersionAction.hpp	(revision f941b14c7a92d23575eccdfcd7bbb7ef127d1bad)
@@ -0,0 +1,31 @@
+/*
+ * VersionAction.hpp
+ *
+ *  Created on: May 8, 2010
+ *      Author: heber
+ */
+
+#ifndef VERSIONACTION_HPP_
+#define VERSIONACTION_HPP_
+
+#include "Actions/Action.hpp"
+#include "version.h"
+
+class CommandLineVersionAction : public Action {
+public:
+  CommandLineVersionAction();
+  virtual ~CommandLineVersionAction();
+
+  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 /* VERSIONACTION_HPP_ */
Index: src/Actions/FragmentationAction/DepthFirstSearchAction.cpp
===================================================================
--- src/Actions/FragmentationAction/DepthFirstSearchAction.cpp	(revision f941b14c7a92d23575eccdfcd7bbb7ef127d1bad)
+++ src/Actions/FragmentationAction/DepthFirstSearchAction.cpp	(revision f941b14c7a92d23575eccdfcd7bbb7ef127d1bad)
@@ -0,0 +1,105 @@
+/*
+ * DepthFirstSearchAction.cpp
+ *
+ *  Created on: May 9, 2010
+ *      Author: heber
+ */
+
+#include "Actions/FragmentationAction/DepthFirstSearchAction.hpp"
+#include "CommandLineParser.hpp"
+#include "atom.hpp"
+#include "config.hpp"
+#include "log.hpp"
+#include "molecule.hpp"
+#include "Descriptors/MoleculeDescriptor.hpp"
+#include "Descriptors/MoleculeIdDescriptor.hpp"
+#include "stackclass.hpp"
+#include "verbose.hpp"
+#include "World.hpp"
+
+#include <iostream>
+#include <string>
+
+using namespace std;
+
+#include "UIElements/UIFactory.hpp"
+#include "UIElements/Dialog.hpp"
+#include "Actions/MapOfActions.hpp"
+
+const char FragmentationDepthFirstSearchAction::NAME[] = "depth-first-search";
+
+FragmentationDepthFirstSearchAction::FragmentationDepthFirstSearchAction() :
+  Action(NAME)
+{}
+
+FragmentationDepthFirstSearchAction::~FragmentationDepthFirstSearchAction()
+{}
+
+Action::state_ptr FragmentationDepthFirstSearchAction::performCall() {
+  Dialog *dialog = UIFactory::getInstance().makeDialog();
+  double distance;
+
+  dialog->queryDouble(NAME, &distance, MapOfActions::getInstance().getDescription(NAME));
+
+  if(dialog->display()) {
+    DoLog(1) && (Log() << Verbose(1) << "Depth-First-Search Analysis." << endl);
+    molecule * const mol = World::getInstance().getMolecule(MoleculeById(0));
+    MoleculeLeafClass *Subgraphs = NULL;      // list of subgraphs from DFS analysis
+    int *MinimumRingSize = new int[mol->AtomCount];
+    atom ***ListOfLocalAtoms = NULL;
+    class StackClass<bond *> *BackEdgeStack = NULL;
+    class StackClass<bond *> *LocalBackEdgeStack = NULL;
+    mol->CreateAdjacencyList(distance, World::getInstance().getConfig()->GetIsAngstroem(), &BondGraph::CovalentMinMaxDistance, NULL);
+    Subgraphs = mol->DepthFirstSearchAnalysis(BackEdgeStack);
+    if (Subgraphs != NULL) {
+      int FragmentCounter = 0;
+      while (Subgraphs->next != NULL) {
+        Subgraphs = Subgraphs->next;
+        Subgraphs->FillBondStructureFromReference(mol, FragmentCounter, ListOfLocalAtoms, false);  // we want to keep the created ListOfLocalAtoms
+        LocalBackEdgeStack = new StackClass<bond *> (Subgraphs->Leaf->BondCount);
+        Subgraphs->Leaf->PickLocalBackEdges(ListOfLocalAtoms[FragmentCounter], BackEdgeStack, LocalBackEdgeStack);
+        Subgraphs->Leaf->CyclicStructureAnalysis(LocalBackEdgeStack, MinimumRingSize);
+        delete(LocalBackEdgeStack);
+        delete(Subgraphs->previous);
+        FragmentCounter++;
+      }
+      delete(Subgraphs);
+      for (int i=0;i<FragmentCounter;i++)
+        Free(&ListOfLocalAtoms[i]);
+      Free(&ListOfLocalAtoms);
+    }
+    delete(BackEdgeStack);
+    delete[](MinimumRingSize);
+    delete dialog;
+    return Action::success;
+  } else {
+    delete dialog;
+    return Action::failure;
+  }
+}
+
+Action::state_ptr FragmentationDepthFirstSearchAction::performUndo(Action::state_ptr _state) {
+//  ParserLoadXyzState *state = assert_cast<ParserLoadXyzState*>(_state.get());
+
+  return Action::failure;
+//  string newName = state->mol->getName();
+//  state->mol->setName(state->lastName);
+//
+//  return Action::state_ptr(new ParserLoadXyzState(state->mol,newName));
+}
+
+Action::state_ptr FragmentationDepthFirstSearchAction::performRedo(Action::state_ptr _state){
+  return Action::failure;
+}
+
+bool FragmentationDepthFirstSearchAction::canUndo() {
+  return false;
+}
+
+bool FragmentationDepthFirstSearchAction::shouldUndo() {
+  return false;
+}
+
+const string FragmentationDepthFirstSearchAction::getName() {
+  return NAME;
+}
Index: src/Actions/FragmentationAction/DepthFirstSearchAction.hpp
===================================================================
--- src/Actions/FragmentationAction/DepthFirstSearchAction.hpp	(revision f941b14c7a92d23575eccdfcd7bbb7ef127d1bad)
+++ src/Actions/FragmentationAction/DepthFirstSearchAction.hpp	(revision f941b14c7a92d23575eccdfcd7bbb7ef127d1bad)
@@ -0,0 +1,30 @@
+/*
+ * DepthFirstSearchAction.hpp
+ *
+ *  Created on: May 9, 2010
+ *      Author: heber
+ */
+
+#ifndef DEPTHFIRSTSEARCHACTION_HPP_
+#define DEPTHFIRSTSEARCHACTION_HPP_
+
+#include "Actions/Action.hpp"
+
+class FragmentationDepthFirstSearchAction : public Action {
+public:
+  FragmentationDepthFirstSearchAction();
+  virtual ~FragmentationDepthFirstSearchAction();
+
+  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 /* DEPTHFIRSTSEARCHACTION_HPP_ */
Index: src/Actions/FragmentationAction/FragmentationAction.cpp
===================================================================
--- src/Actions/FragmentationAction/FragmentationAction.cpp	(revision f941b14c7a92d23575eccdfcd7bbb7ef127d1bad)
+++ src/Actions/FragmentationAction/FragmentationAction.cpp	(revision f941b14c7a92d23575eccdfcd7bbb7ef127d1bad)
@@ -0,0 +1,74 @@
+/*
+ * FragmentationAction.cpp
+ *
+ *  Created on: May 9, 2010
+ *      Author: heber
+ */
+
+#include "Actions/FragmentationAction/FragmentationAction.hpp"
+#include "CommandLineParser.hpp"
+#include "atom.hpp"
+#include "config.hpp"
+#include "log.hpp"
+#include "molecule.hpp"
+#include "Descriptors/MoleculeDescriptor.hpp"
+#include "stackclass.hpp"
+#include "World.hpp"
+
+#include <iostream>
+#include <string>
+
+using namespace std;
+
+#include "UIElements/UIFactory.hpp"
+#include "UIElements/Dialog.hpp"
+#include "Actions/MapOfActions.hpp"
+
+const char FragmentationFragmentationAction::NAME[] = "subspace-dissect";
+
+FragmentationFragmentationAction::FragmentationFragmentationAction() :
+  Action(NAME)
+{}
+
+FragmentationFragmentationAction::~FragmentationFragmentationAction()
+{}
+
+Action::state_ptr FragmentationFragmentationAction::performCall() {
+  Dialog *dialog = UIFactory::getInstance().makeDialog();
+
+  dialog->queryEmpty(NAME, MapOfActions::getInstance().getDescription(NAME));
+
+  if(dialog->display()) {
+    delete dialog;
+    return Action::success;
+  } else {
+    delete dialog;
+    return Action::failure;
+  }
+}
+
+Action::state_ptr FragmentationFragmentationAction::performUndo(Action::state_ptr _state) {
+//  ParserLoadXyzState *state = assert_cast<ParserLoadXyzState*>(_state.get());
+
+  return Action::failure;
+//  string newName = state->mol->getName();
+//  state->mol->setName(state->lastName);
+//
+//  return Action::state_ptr(new ParserLoadXyzState(state->mol,newName));
+}
+
+Action::state_ptr FragmentationFragmentationAction::performRedo(Action::state_ptr _state){
+  return Action::failure;
+}
+
+bool FragmentationFragmentationAction::canUndo() {
+  return false;
+}
+
+bool FragmentationFragmentationAction::shouldUndo() {
+  return false;
+}
+
+const string FragmentationFragmentationAction::getName() {
+  return NAME;
+}
Index: src/Actions/FragmentationAction/FragmentationAction.hpp
===================================================================
--- src/Actions/FragmentationAction/FragmentationAction.hpp	(revision f941b14c7a92d23575eccdfcd7bbb7ef127d1bad)
+++ src/Actions/FragmentationAction/FragmentationAction.hpp	(revision f941b14c7a92d23575eccdfcd7bbb7ef127d1bad)
@@ -0,0 +1,30 @@
+/*
+ * FragmentationAction.hpp
+ *
+ *  Created on: May 9, 2010
+ *      Author: heber
+ */
+
+#ifndef FRAGMENTATIONACTION_HPP_
+#define FRAGMENTATIONACTION_HPP_
+
+#include "Actions/Action.hpp"
+
+class FragmentationFragmentationAction : public Action {
+public:
+  FragmentationFragmentationAction();
+  virtual ~FragmentationFragmentationAction();
+
+  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 /* FRAGMENTATIONACTION_HPP_ */
Index: src/Actions/FragmentationAction/SubgraphDissectionAction.cpp
===================================================================
--- src/Actions/FragmentationAction/SubgraphDissectionAction.cpp	(revision f941b14c7a92d23575eccdfcd7bbb7ef127d1bad)
+++ src/Actions/FragmentationAction/SubgraphDissectionAction.cpp	(revision f941b14c7a92d23575eccdfcd7bbb7ef127d1bad)
@@ -0,0 +1,74 @@
+/*
+ * SubgraphDissectionAction.cpp
+ *
+ *  Created on: May 9, 2010
+ *      Author: heber
+ */
+
+#include "Actions/FragmentationAction/SubgraphDissectionAction.hpp"
+#include "CommandLineParser.hpp"
+#include "atom.hpp"
+#include "config.hpp"
+#include "log.hpp"
+#include "molecule.hpp"
+#include "Descriptors/MoleculeDescriptor.hpp"
+#include "stackclass.hpp"
+#include "World.hpp"
+
+#include <iostream>
+#include <string>
+
+using namespace std;
+
+#include "UIElements/UIFactory.hpp"
+#include "UIElements/Dialog.hpp"
+#include "Actions/MapOfActions.hpp"
+
+const char FragmentationSubgraphDissectionAction::NAME[] = "subspace-dissect";
+
+FragmentationSubgraphDissectionAction::FragmentationSubgraphDissectionAction() :
+  Action(NAME)
+{}
+
+FragmentationSubgraphDissectionAction::~FragmentationSubgraphDissectionAction()
+{}
+
+Action::state_ptr FragmentationSubgraphDissectionAction::performCall() {
+  Dialog *dialog = UIFactory::getInstance().makeDialog();
+
+  dialog->queryEmpty(NAME, MapOfActions::getInstance().getDescription(NAME));
+
+  if(dialog->display()) {
+    delete dialog;
+    return Action::success;
+  } else {
+    delete dialog;
+    return Action::failure;
+  }
+}
+
+Action::state_ptr FragmentationSubgraphDissectionAction::performUndo(Action::state_ptr _state) {
+//  ParserLoadXyzState *state = assert_cast<ParserLoadXyzState*>(_state.get());
+
+  return Action::failure;
+//  string newName = state->mol->getName();
+//  state->mol->setName(state->lastName);
+//
+//  return Action::state_ptr(new ParserLoadXyzState(state->mol,newName));
+}
+
+Action::state_ptr FragmentationSubgraphDissectionAction::performRedo(Action::state_ptr _state){
+  return Action::failure;
+}
+
+bool FragmentationSubgraphDissectionAction::canUndo() {
+  return false;
+}
+
+bool FragmentationSubgraphDissectionAction::shouldUndo() {
+  return false;
+}
+
+const string FragmentationSubgraphDissectionAction::getName() {
+  return NAME;
+}
Index: src/Actions/FragmentationAction/SubgraphDissectionAction.hpp
===================================================================
--- src/Actions/FragmentationAction/SubgraphDissectionAction.hpp	(revision f941b14c7a92d23575eccdfcd7bbb7ef127d1bad)
+++ src/Actions/FragmentationAction/SubgraphDissectionAction.hpp	(revision f941b14c7a92d23575eccdfcd7bbb7ef127d1bad)
@@ -0,0 +1,30 @@
+/*
+ * SubgraphDissectionAction.hpp
+ *
+ *  Created on: May 9, 2010
+ *      Author: heber
+ */
+
+#ifndef SUBGRAPHDISSECTIONACTION_HPP_
+#define SUBGRAPHDISSECTIONACTION_HPP_f
+
+#include "Actions/Action.hpp"
+
+class FragmentationSubgraphDissectionAction : public Action {
+public:
+  FragmentationSubgraphDissectionAction();
+  virtual ~FragmentationSubgraphDissectionAction();
+
+  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 /* SUBGRAPHDISSECTIONACTION_HPP_ */
Index: src/Actions/MapOfActions.cpp
===================================================================
--- src/Actions/MapOfActions.cpp	(revision f941b14c7a92d23575eccdfcd7bbb7ef127d1bad)
+++ src/Actions/MapOfActions.cpp	(revision f941b14c7a92d23575eccdfcd7bbb7ef127d1bad)
@@ -0,0 +1,445 @@
+/*
+ * MapOfActions.cpp
+ *
+ *  Created on: 10.05.2010
+ *      Author: heber
+ */
+
+using namespace std;
+
+#include "Patterns/Singleton_impl.hpp"
+#include "Actions/MapOfActions.hpp"
+#include "Helpers/Assert.hpp"
+
+#include "CommandLineParser.hpp"
+#include "log.hpp"
+#include "verbose.hpp"
+
+/** Constructor of class MapOfActions.
+ *
+ */
+MapOfActions::MapOfActions()
+{
+  // initialise lookup map
+  CmdParserLookup[&generic] = &(CommandLineParser::getInstance().generic);
+  CmdParserLookup[&config] = &(CommandLineParser::getInstance().config);
+  CmdParserLookup[&hidden] = &(CommandLineParser::getInstance().hidden);
+  CmdParserLookup[&visible] = &(CommandLineParser::getInstance().visible);
+
+  // keys for actions
+  DescriptionMap["add-atom"] = "add atom of specified element";
+  DescriptionMap["bond-table"] = "setting name of the bond length table file";
+  DescriptionMap["bond-file"] = "name of the bond file";
+  DescriptionMap["boundary"] = "change box to add an empty boundary around all atoms";
+  DescriptionMap["bound-in-box"] = "bound all atoms in the domain";
+  DescriptionMap["center-edge"] = "center edge of all atoms on (0,0,0)";
+  DescriptionMap["center-in-box"] = "center all atoms in the domain";
+  DescriptionMap["change-box"] = "change the symmetrc matrix of the simulation domain";
+  DescriptionMap["change-element"] = "change the element of an atom";
+  DescriptionMap["change-molname"] = "change the name of a molecule";
+  DescriptionMap["convex-envelope"] = "create the convex envelope for a molecule";
+  DescriptionMap["default-molname"] = "set the default name of new molecules";
+  DescriptionMap["depth-first-search"] = "Depth-First Search analysis of the molecular system";
+  DescriptionMap["element-db"] = "setting the path where the element databases can be found";
+  DescriptionMap["fastparsing"] = "setting whether trajectories shall be parsed completely (n) or just first step (y)";
+  DescriptionMap["fill-molecule"] = "fill empty space of box with a filler molecule";
+  DescriptionMap["fragment-mol"] = "create for a given molecule into fragments up to given order";
+  DescriptionMap["help"] = "produce help message";
+  DescriptionMap["linear-interpolate"] = "linear interpolation in discrete steps between start and end position of a molecule";
+  DescriptionMap["nonconvex-envelope"] = "create the non-convex envelope for a molecule";
+  DescriptionMap["molecular-volume"] = "calculate the volume of a given molecule";
+  DescriptionMap["pair-correlation"] = "pair correlation analysis between two elements";
+  DescriptionMap["pair-correlation-point"] = "pair correlation analysis between atoms of a element to a given point";
+  DescriptionMap["pair-correlation-surface"] = "pair correlation analysis between atoms of a given element and a surface";
+  DescriptionMap["parse-xyz"] = "parse xyz file into World";
+  DescriptionMap["principal-axis-system"] = "calculate the principal axis system of the specified molecule";
+  DescriptionMap["remove-atom"] = "remove a specified atom";
+  DescriptionMap["remove-sphere"] = "remove sphere of atoms of around a specified atom";
+  DescriptionMap["repeat-box"] = "create periodic copies of the simulation box per axis";
+  DescriptionMap["rotate-to-pas"] = "calculate the principal axis system of the specified molecule and rotate specified axis to align with main axis";
+  DescriptionMap["set-basis"] = "set the name of the gaussian basis set for MPQC";
+  DescriptionMap["save-adjacency"] = "name of the adjacency file to write to";
+  DescriptionMap["save-bonds"] = "name of the bonds file to write to";
+  DescriptionMap["save-temperature"] = "name of the temperature file to write to";
+  DescriptionMap["subspace-dissect"] = "dissect the molecular system into molecules representing disconnected subgraphs";
+  DescriptionMap["suspend-in-water"] = "suspend the given molecule in water such that in the domain the mean density is as specified";
+  DescriptionMap["translate-mol"] = "translate molecule by given vector";
+  DescriptionMap["verbose"] = "set verbosity level";
+  DescriptionMap["verlet-integrate"] = "perform verlet integration of a given force file";
+  DescriptionMap["version"] = "show version";
+  // keys for values
+  DescriptionMap["bin-output-file"] = "name of the bin output file";
+  DescriptionMap["bin-end"] = "start of the last bin";
+  DescriptionMap["bin-start"] = "start of the first bin";
+  DescriptionMap["bin-width"] = "width of the bins";
+  DescriptionMap["distance"] = "distance in space";
+  DescriptionMap["distances"] = "list of three of distances in space, one for each axis direction";
+  DescriptionMap["element"] = "set of elements";
+  DescriptionMap["end-mol"] = "last or end step";
+  DescriptionMap["input"] = "name of input file";
+  DescriptionMap["length"] = "length in space";
+  DescriptionMap["lengths"] = "list of three of lengths in space, one for each axis direction";
+  DescriptionMap["MaxDistance"] = "maximum distance in space";
+  DescriptionMap["molecule-by-id"] = "index of a molecule";
+  DescriptionMap["output-file"] = "name of the output file";
+  DescriptionMap["periodic"] = "system is constraint to periodic boundary conditions (y/n)";
+  DescriptionMap["position"] = "position in R^3 space";
+  DescriptionMap["start-mol"] = "first or start step";
+
+  // short forms for the actions
+  ShortFormMap["add-atom"] = "a";
+  ShortFormMap["bond-table"] = "g";
+  ShortFormMap["bond-file"] = "A";
+  ShortFormMap["boundary"] = "c";
+  ShortFormMap["bound-in-box"] = "B";
+  ShortFormMap["center-edge"] = "O";
+  ShortFormMap["center-in-box"] = "b";
+  ShortFormMap["change-element"] = "E";
+  ShortFormMap["convex-envelope"] = "o";
+  ShortFormMap["default-molname"] = "X";
+  ShortFormMap["depth-first-search"] = "D";
+  ShortFormMap["element-db"] = "e";
+  ShortFormMap["fastparsing"] = "n";
+  ShortFormMap["fill-molecule"] = "F";
+  ShortFormMap["fragment-mol"] = "f";
+  ShortFormMap["help"] = "h";
+  ShortFormMap["input"] = "i";
+  ShortFormMap["linear-interpolate"] = "L";
+  ShortFormMap["nonconvex-envelope"] = "N";
+  ShortFormMap["pair-correlation"] = "CE";
+  ShortFormMap["pair-correlation-point"] = "CP";
+  ShortFormMap["pair-correlation-surface"] = "CS";
+  ShortFormMap["parse-xyz"] = "p";
+  ShortFormMap["remove-atom"] = "r";
+  ShortFormMap["remove-sphere"] = "R";
+  ShortFormMap["repeat-box"] = "d";
+  ShortFormMap["rotate-to-pas"] = "m";
+  ShortFormMap["save-adjacency"] = "J";
+  ShortFormMap["save-bonds"] = "j";
+  ShortFormMap["save-temperature"] = "S";
+  ShortFormMap["scale-box"] = "s";
+  ShortFormMap["set-basis"] = "M";
+  ShortFormMap["subspace-dissect"] = "I";
+  ShortFormMap["suspend-in-water"] = "U";
+  ShortFormMap["translate-mol"] = "t";
+  ShortFormMap["verbose"] = "V";
+  ShortFormMap["verlet-integrate"] = "P";
+  ShortFormMap["version"] = "v";
+
+  // value types for the actions
+  TypeMap["add-atom"] = Atom;
+  TypeMap["bond-file"] = String;
+  TypeMap["bond-table"] = String;
+  TypeMap["boundary"] = Vector;
+  TypeMap["change-box"] = Vector;
+  TypeMap["change-element"] = Element;
+  TypeMap["change-molname"] = String;
+  TypeMap["convex-envelope"] = Molecule;
+  TypeMap["default-molname"] = String;
+  TypeMap["depth-first-search"] = Double;
+  TypeMap["element-db"] = String;
+  TypeMap["end-mol"] = Molecule;
+  TypeMap["fastparsing"] = Boolean;
+  TypeMap["fill-molecule"] = String;
+  TypeMap["fragment-mol"] = Molecule;
+  TypeMap["input"] = String;
+  TypeMap["linear-interpolate"] = String;
+  TypeMap["molecular-volume"] = Molecule;
+  TypeMap["nonconvex-envelope"] = Molecule;
+  TypeMap["parse-xyz"] = String;
+  TypeMap["principal-axis-system"] = Axis;
+  TypeMap["remove-atom"] = Atom;
+  TypeMap["remove-sphere"] = Atom;
+  TypeMap["repeat-box"] = ListOfInts;
+  TypeMap["rotate-to-pas"] = Molecule;
+  TypeMap["save-adjacency"] = String;
+  TypeMap["save-bonds"] = String;
+  TypeMap["save-temperature"] = String;
+  TypeMap["scale-box"] = Vector;
+  TypeMap["set-basis"] = String;
+  TypeMap["start-mol"] = Molecule;
+  TypeMap["suspend-in-water"] = Molecule;
+  TypeMap["translate-mol"] = Vector;
+  TypeMap["verlet-integrate"] = String;
+  TypeMap["verbose"] = Integer;
+  // value types for the values
+  TypeMap["bin-output-file"] = String;
+  TypeMap["bin-end"] = Double;
+  TypeMap["bin-start"] = Double;
+  TypeMap["distance"] = Double;
+  TypeMap["distances"] = ListOfDoubles;
+  TypeMap["elements"] = Element;
+  TypeMap["elements"] = ListOfElements;
+  TypeMap["length"] = Double;
+  TypeMap["lengths"] = ListOfDoubles;
+  TypeMap["MaxDistance"] = Double;
+  TypeMap["molecule-by-id"] = Molecule;
+  TypeMap["output-file"] = String;
+  TypeMap["periodic"] = Boolean;
+  TypeMap["position"] = Vector;
+
+  // list of generic actions
+//	generic.insert("add-atom");
+//  generic.insert("bond-file");
+//	generic.insert("bond-table");
+//  generic.insert("boundary");
+//  generic.insert("bound-in-box");
+//  generic.insert("center-edge");
+//  generic.insert("center-in-box");
+//	generic.insert("change-box");
+//  generic.insert("change-molname");
+//	generic.insert("change-element");
+//  generic.insert("convex-envelope");
+//	generic.insert("default-molname");
+//	generic.insert("depth-first-search");
+//	generic.insert("element-db");
+//	generic.insert("fastparsing");
+//  generic.insert("fill-molecule");
+//  generic.insert("fragment-mol");
+  generic.insert("help");
+//	generic.insert("linear-interpolate");
+//  generic.insert("molecular-volume");
+//  generic.insert("nonconvex-envelope");
+//	generic.insert("pair-correlation");
+//	generic.insert("pair-correlation-point");
+//	generic.insert("pair-correlation-surface");
+//	generic.insert("parse-xyz");
+//  generic.insert("principal-axis-system");
+//  generic.insert("remove-atom");
+//  generic.insert("remove-sphere");
+//  generic.insert("rotate-to-pas");
+//	generic.insert("save-adjacency");
+//  generic.insert("save-bonds");
+//  generic.insert("save-temperature");
+//  generic.insert("scale-box");
+//  generic.insert("set-basis");
+//	generic.insert("subspace-dissect");
+//  generic.insert("suspend-in-water");
+//  generic.insert("translate-mol");
+	generic.insert("verbose");
+//  generic.insert("verlet-integrate");
+	generic.insert("version");
+//	// list of generic values
+//	generic.insert("bin-output-file");
+//  generic.insert("bin-end");
+//  generic.insert("bin-start");
+//  generic.insert("distance");
+//  generic.insert("distances");
+//  generic.insert("element");
+//  generic.insert("end-mol");
+    generic.insert("input");
+//  generic.insert("length");
+//  generic.insert("lengths");
+//  generic.insert("MaxDistance");
+//  generic.insert("molecule-by-id");
+//  generic.insert("output-file");
+//  generic.insert("periodic");
+//  generic.insert("position");
+//  generic.insert("start-mol");
+
+    // positional arguments
+    inputfile.insert("input");
+}
+
+/** Destructor of class MapOfActions.
+ *
+ */
+MapOfActions::~MapOfActions()
+{
+  DescriptionMap.clear();
+}
+
+/** Adds all options to the CommandLineParser.
+ *
+ */
+void MapOfActions::AddOptionsToParser()
+{
+  // add other options
+  for (map< set<string>*, po::options_description* >::iterator ListRunner = CmdParserLookup.begin(); ListRunner != CmdParserLookup.end(); ++ListRunner) {
+    for (set<string>::iterator OptionRunner = ListRunner->first->begin(); OptionRunner != ListRunner->first->end(); ++OptionRunner) {
+      if (hasValue(*OptionRunner)) {
+        DoLog(0) && (Log() << Verbose(0) << "Adding option " << *OptionRunner << " with type " << TypeMap[*OptionRunner] << " to CommandLineParser." << endl);
+           switch((enum OptionTypes) TypeMap[*OptionRunner]) {
+          default:
+          case None:
+            ListRunner->second->add_options()
+              (getKeyAndShortForm(*OptionRunner).c_str(), getDescription(*OptionRunner).c_str())
+              ;
+            break;
+          case Boolean:
+            ListRunner->second->add_options()
+              (getKeyAndShortForm(*OptionRunner).c_str(), po::value< bool >(), getDescription(*OptionRunner).c_str())
+              ;
+            break;
+          case Integer:
+            ListRunner->second->add_options()
+              (getKeyAndShortForm(*OptionRunner).c_str(), po::value< int >(), getDescription(*OptionRunner).c_str())
+              ;
+            break;
+          case ListOfInts:
+            ListRunner->second->add_options()
+              (getKeyAndShortForm(*OptionRunner).c_str(), po::value< vector<int> >(), getDescription(*OptionRunner).c_str())
+              ;
+            break;
+          case Double:
+            ListRunner->second->add_options()
+              (getKeyAndShortForm(*OptionRunner).c_str(), po::value< double >(), getDescription(*OptionRunner).c_str())
+              ;
+            break;
+          case ListOfDoubles:
+            ListRunner->second->add_options()
+              (getKeyAndShortForm(*OptionRunner).c_str(), po::value< vector<double> >(), getDescription(*OptionRunner).c_str())
+              ;
+            break;
+          case String:
+            ListRunner->second->add_options()
+              (getKeyAndShortForm(*OptionRunner).c_str(), po::value< std::string >(), getDescription(*OptionRunner).c_str())
+              ;
+            break;
+          case Axis:
+            ListRunner->second->add_options()
+              (getKeyAndShortForm(*OptionRunner).c_str(), po::value< int >(), getDescription(*OptionRunner).c_str())
+              ;
+            break;
+          case Vector:
+            ListRunner->second->add_options()
+              (getKeyAndShortForm(*OptionRunner).c_str(), po::value< vector<double> >(), getDescription(*OptionRunner).c_str())
+              ;
+            break;
+          case Box:
+            ListRunner->second->add_options()
+              (getKeyAndShortForm(*OptionRunner).c_str(), po::value< vector<double> >(), getDescription(*OptionRunner).c_str())
+              ;
+            break;
+          case Molecule:
+            ListRunner->second->add_options()
+              (getKeyAndShortForm(*OptionRunner).c_str(), po::value< int >(), getDescription(*OptionRunner).c_str())
+              ;
+            break;
+          case ListOfMolecules:
+            ListRunner->second->add_options()
+              (getKeyAndShortForm(*OptionRunner).c_str(), po::value< vector<int> >(), getDescription(*OptionRunner).c_str())
+              ;
+            break;
+          case Atom:
+            ListRunner->second->add_options()
+              (getKeyAndShortForm(*OptionRunner).c_str(), po::value< int >(), getDescription(*OptionRunner).c_str())
+              ;
+            break;
+          case ListOfAtoms:
+            ListRunner->second->add_options()
+              (getKeyAndShortForm(*OptionRunner).c_str(), po::value< vector<int> >(), getDescription(*OptionRunner).c_str())
+              ;
+            break;
+          case Element:
+            ListRunner->second->add_options()
+              (getKeyAndShortForm(*OptionRunner).c_str(), po::value< int >(), getDescription(*OptionRunner).c_str())
+              ;
+            break;
+          case ListOfElements:
+            ListRunner->second->add_options()
+              (getKeyAndShortForm(*OptionRunner).c_str(), po::value< vector<int> >(), getDescription(*OptionRunner).c_str())
+              ;
+            break;
+        }
+      } else {
+        DoLog(0) && (Log() << Verbose(0) << "Adding option " << *OptionRunner << " to CommandLineParser." << endl);
+        ListRunner->second->add_options()
+          (getKeyAndShortForm(*OptionRunner).c_str(), getDescription(*OptionRunner).c_str())
+          ;
+      }
+    }
+  }
+  // add positional arguments
+  for (set<string>::iterator OptionRunner = inputfile.begin(); OptionRunner != inputfile.end(); ++OptionRunner) {
+    DoLog(0) && (Log() << Verbose(0) << "Adding option " << *OptionRunner << " to positional CommandLineParser." << endl);
+    CommandLineParser::getInstance().inputfile.add((*OptionRunner).c_str(), -1);
+  }
+  cout << "Name for position 1: " << CommandLineParser::getInstance().inputfile.name_for_position(1) << endl;
+}
+
+/** Getter for MapOfActions:DescriptionMap.
+ * Note that we assert when action does not exist in CommandLineParser::DescriptionMap.
+ * \param actionname name of the action to lookup
+ * \return Description of the action
+ */
+std::string MapOfActions::getDescription(string actionname)
+{
+  ASSERT(DescriptionMap.find(actionname) != DescriptionMap.end(), "Unknown action name passed to MapOfActions::getDescription");
+  return DescriptionMap[actionname];
+}
+
+/** Specific Getter for a MapOfActions:ShortFormMap.
+ * If action has a short for, then combination is as "actionname,ShortForm" (this is
+ * the desired format for boost::program_options). If no short form exists in the map,
+ * just actionname will be returned
+ * Note that we assert when action does not exist in CommandLineParser::DescriptionMap.
+ * \param actionname name of the action to lookup
+ * \return actionname,ShortForm or Description of the action
+ */
+std::string MapOfActions::getKeyAndShortForm(string actionname)
+{
+  stringstream output;
+  ASSERT(DescriptionMap.find(actionname) != DescriptionMap.end(), "Unknown action name passed to MapOfActions::getDescriptionAndShortForm");
+  output << actionname;
+  if (ShortFormMap.find(actionname) != DescriptionMap.end())
+    output << "," << ShortFormMap[actionname];
+  return output.str();
+}
+
+/** Getter for MapOfActions:ShortFormMap.
+ * Note that we assert when action does not exist CommandLineParser::ShortFormMap.
+ * \param actionname name of the action to lookup
+ * \return ShortForm of the action
+ */
+std::string MapOfActions::getShortForm(string actionname)
+{
+  ASSERT(ShortFormMap.find(actionname) != ShortFormMap.end(), "Unknown action name passed to MapOfActions::getShortForm");
+  return ShortFormMap[actionname];
+}
+
+/** Returns whether the given action needs a value or not.
+ * \param actionname name of the action to look up
+ * \return true - value is needed, false - no value is stored in MapOfActions::TypeMap
+ */
+bool MapOfActions::hasValue(string actionname)
+{
+  return (TypeMap.find(actionname) != TypeMap.end());
+}
+
+/** Getter for MapOfActions::TypeMap.
+ * \param actionname name of the action to look up
+ * \return type of the action
+ */
+enum MapOfActions::OptionTypes MapOfActions::getValueType(string actionname)
+{
+  return TypeMap[actionname];
+}
+
+/** Searches whether action is registered with CommandLineParser.
+ * Note that this method is only meant transitionally for ParseCommandLineOptions' removal.
+ * I.e. All actions that are already handled by the new CommandLineUIFactory can be checked
+ * by this function.
+ * \param shortform command short form to look for
+ * \return true - action has been registered, false - action has not been registered.
+ */
+bool MapOfActions::isShortFormPresent(string shortform)
+{
+  bool result = false;
+  string actionname;
+  for (map<std::string, std::string>::iterator ShortFormRunner = ShortFormMap.begin(); ShortFormRunner != ShortFormMap.end(); ++ShortFormRunner)
+    if (ShortFormRunner->second == shortform) {
+      actionname = ShortFormRunner->first;
+      break;
+    }
+  result = result || (generic.find(actionname) != generic.end());
+  result = result || (config.find(actionname) != config.end());
+  result = result || (hidden.find(actionname) != hidden.end());
+  result = result || (visible.find(actionname) != visible.end());
+  result = result || (inputfile.find(actionname) != inputfile.end());
+  return result;
+}
+
+
+
+CONSTRUCT_SINGLETON(MapOfActions)
Index: src/Actions/MapOfActions.hpp
===================================================================
--- src/Actions/MapOfActions.hpp	(revision f941b14c7a92d23575eccdfcd7bbb7ef127d1bad)
+++ src/Actions/MapOfActions.hpp	(revision f941b14c7a92d23575eccdfcd7bbb7ef127d1bad)
@@ -0,0 +1,61 @@
+/*
+ * MapOfActions.hpp
+ *
+ *  Created on: 10.05.2010
+ *      Author: heber
+ */
+
+#ifndef MAPOFACTIONS_HPP_
+#define MAPOFACTIONS_HPP_
+
+#include "Helpers/Assert.hpp"
+#include <boost/program_options.hpp>
+#include <map>
+#include <set>
+
+class MapOfActionsTest;
+
+#include "Patterns/Singleton.hpp"
+
+namespace po = boost::program_options;
+
+class MapOfActions : public Singleton<MapOfActions> {
+  friend class Singleton<MapOfActions>;
+  friend class MapOfActionsTest;
+public:
+  enum OptionTypes { None, Boolean, Integer, ListOfInts, Double, ListOfDoubles, String, Axis, Vector, Box, Molecule, ListOfMolecules, Atom, ListOfAtoms, Element, ListOfElements };
+
+  // getter for the action descriptions and short forms
+  std::string getDescription(string actionname);
+  std::string getKeyAndShortForm(string actionname);
+  std::string getShortForm(string actionname);
+
+  void AddOptionsToParser();
+
+  // check presence and getter for action type
+  bool hasValue(string actionname);
+  bool isShortFormPresent(string shortform);
+  enum OptionTypes getValueType(string actionname);
+
+  set<string> generic;
+  set<string> config;
+  set<string> hidden;
+  set<string> visible;
+  set<string> inputfile;
+
+private:
+  // private constructor and destructor
+  MapOfActions();
+  virtual ~MapOfActions();
+
+  // lookup list from our configs to the ones of CommandLineParser
+  map< set<std::string> *, po::options_description *> CmdParserLookup;
+
+  // map of the action names and their description
+  map<std::string, std::string> DescriptionMap;
+  map<std::string, std::string> ShortFormMap;
+  map<std::string, enum OptionTypes > TypeMap;
+};
+
+
+#endif /* MAPOFACTIONS_HPP_ */
Index: src/Actions/MoleculeAction/BondFileAction.cpp
===================================================================
--- src/Actions/MoleculeAction/BondFileAction.cpp	(revision f941b14c7a92d23575eccdfcd7bbb7ef127d1bad)
+++ src/Actions/MoleculeAction/BondFileAction.cpp	(revision f941b14c7a92d23575eccdfcd7bbb7ef127d1bad)
@@ -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 f941b14c7a92d23575eccdfcd7bbb7ef127d1bad)
+++ src/Actions/MoleculeAction/BondFileAction.hpp	(revision f941b14c7a92d23575eccdfcd7bbb7ef127d1bad)
@@ -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 f941b14c7a92d23575eccdfcd7bbb7ef127d1bad)
+++ src/Actions/MoleculeAction/ChangeNameAction.cpp	(revision f941b14c7a92d23575eccdfcd7bbb7ef127d1bad)
@@ -0,0 +1,87 @@
+/*
+ * ChangeNameAction.cpp
+ *
+ *  Created on: Jan 15, 2010
+ *      Author: crueger
+ */
+
+#include "Actions/MoleculeAction/ChangeNameAction.hpp"
+
+#include <iostream>
+#include <string>
+
+using namespace std;
+
+#include "UIElements/UIFactory.hpp"
+#include "UIElements/Dialog.hpp"
+#include "Actions/MapOfActions.hpp"
+
+#include "atom.hpp"
+#include "molecule.hpp"
+
+/****** MoleculeChangeNameAction *****/
+
+// memento to remember the state when undoing
+
+class MoleculeChangeNameState : public ActionState {
+public:
+  MoleculeChangeNameState(molecule* _mol,std::string _lastName) :
+    mol(_mol),
+    lastName(_lastName)
+  {}
+  molecule* mol;
+  std::string lastName;
+};
+
+const char MoleculeChangeNameAction::NAME[] = "Change filename of Molecule";
+
+MoleculeChangeNameAction::MoleculeChangeNameAction() :
+  Action(NAME)
+{}
+
+MoleculeChangeNameAction::~MoleculeChangeNameAction()
+{}
+
+Action::state_ptr MoleculeChangeNameAction::performCall() {
+  string filename;
+  molecule *mol = NULL;
+  Dialog *dialog = UIFactory::getInstance().makeDialog();
+
+  dialog->queryMolecule(NAME, &mol, MapOfActions::getInstance().getDescription(NAME));
+  dialog->queryString("Enter name: ",&filename);
+
+  if(dialog->display()) {
+    string oldName = mol->getName();
+    mol->setName(filename);
+    delete dialog;
+    return Action::state_ptr(new MoleculeChangeNameState(mol,oldName));
+  }
+  delete dialog;
+  return Action::failure;
+}
+
+Action::state_ptr MoleculeChangeNameAction::performUndo(Action::state_ptr _state) {
+  MoleculeChangeNameState *state = assert_cast<MoleculeChangeNameState*>(_state.get());
+
+  string newName = state->mol->getName();
+  state->mol->setName(state->lastName);
+
+  return Action::state_ptr(new MoleculeChangeNameState(state->mol,newName));
+}
+
+Action::state_ptr MoleculeChangeNameAction::performRedo(Action::state_ptr _state){
+  // Undo and redo have to do the same for this action
+  return performUndo(_state);
+}
+
+bool MoleculeChangeNameAction::canUndo() {
+  return true;
+}
+
+bool MoleculeChangeNameAction::shouldUndo() {
+  return true;
+}
+
+const string MoleculeChangeNameAction::getName() {
+  return NAME;
+}
Index: src/Actions/MoleculeAction/ChangeNameAction.hpp
===================================================================
--- src/Actions/MoleculeAction/ChangeNameAction.hpp	(revision f941b14c7a92d23575eccdfcd7bbb7ef127d1bad)
+++ src/Actions/MoleculeAction/ChangeNameAction.hpp	(revision f941b14c7a92d23575eccdfcd7bbb7ef127d1bad)
@@ -0,0 +1,35 @@
+/*
+ * ChangeNameAction.hpp
+ *
+ *  Created on: Jan 15, 2010
+ *      Author: crueger
+ */
+
+#ifndef CHANGENAMEACTION_HPP
+#define CHANGENAMEACTION_HPP
+
+#include "Actions/Action.hpp"
+#include "Actions/Process.hpp"
+
+class MoleculeListClass;
+
+class MoleculeChangeNameAction : public Action {
+public:
+  MoleculeChangeNameAction();
+  virtual ~MoleculeChangeNameAction();
+
+  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);
+
+  MoleculeListClass *molecules;
+  static const char NAME[];
+};
+
+
+#endif // CHANGENAMEACTION_HPP
Index: src/Actions/MoleculeAction/FillWithMoleculeAction.cpp
===================================================================
--- src/Actions/MoleculeAction/FillWithMoleculeAction.cpp	(revision f941b14c7a92d23575eccdfcd7bbb7ef127d1bad)
+++ src/Actions/MoleculeAction/FillWithMoleculeAction.cpp	(revision f941b14c7a92d23575eccdfcd7bbb7ef127d1bad)
@@ -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 f941b14c7a92d23575eccdfcd7bbb7ef127d1bad)
+++ src/Actions/MoleculeAction/FillWithMoleculeAction.hpp	(revision f941b14c7a92d23575eccdfcd7bbb7ef127d1bad)
@@ -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 f941b14c7a92d23575eccdfcd7bbb7ef127d1bad)
+++ src/Actions/MoleculeAction/LinearInterpolationofTrajectoriesAction.cpp	(revision f941b14c7a92d23575eccdfcd7bbb7ef127d1bad)
@@ -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 f941b14c7a92d23575eccdfcd7bbb7ef127d1bad)
+++ src/Actions/MoleculeAction/LinearInterpolationofTrajectoriesAction.hpp	(revision f941b14c7a92d23575eccdfcd7bbb7ef127d1bad)
@@ -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 f941b14c7a92d23575eccdfcd7bbb7ef127d1bad)
+++ src/Actions/MoleculeAction/RotateToPrincipalAxisSystemAction.cpp	(revision f941b14c7a92d23575eccdfcd7bbb7ef127d1bad)
@@ -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 f941b14c7a92d23575eccdfcd7bbb7ef127d1bad)
+++ src/Actions/MoleculeAction/RotateToPrincipalAxisSystemAction.hpp	(revision f941b14c7a92d23575eccdfcd7bbb7ef127d1bad)
@@ -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 f941b14c7a92d23575eccdfcd7bbb7ef127d1bad)
+++ src/Actions/MoleculeAction/SaveAdjacencyAction.cpp	(revision f941b14c7a92d23575eccdfcd7bbb7ef127d1bad)
@@ -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 f941b14c7a92d23575eccdfcd7bbb7ef127d1bad)
+++ src/Actions/MoleculeAction/SaveAdjacencyAction.hpp	(revision f941b14c7a92d23575eccdfcd7bbb7ef127d1bad)
@@ -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 f941b14c7a92d23575eccdfcd7bbb7ef127d1bad)
+++ src/Actions/MoleculeAction/SaveBondsAction.cpp	(revision f941b14c7a92d23575eccdfcd7bbb7ef127d1bad)
@@ -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 f941b14c7a92d23575eccdfcd7bbb7ef127d1bad)
+++ src/Actions/MoleculeAction/SaveBondsAction.hpp	(revision f941b14c7a92d23575eccdfcd7bbb7ef127d1bad)
@@ -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 f941b14c7a92d23575eccdfcd7bbb7ef127d1bad)
+++ src/Actions/MoleculeAction/SaveTemperatureAction.cpp	(revision f941b14c7a92d23575eccdfcd7bbb7ef127d1bad)
@@ -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 f941b14c7a92d23575eccdfcd7bbb7ef127d1bad)
+++ src/Actions/MoleculeAction/SaveTemperatureAction.hpp	(revision f941b14c7a92d23575eccdfcd7bbb7ef127d1bad)
@@ -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 f941b14c7a92d23575eccdfcd7bbb7ef127d1bad)
+++ src/Actions/MoleculeAction/SuspendInWaterAction.cpp	(revision f941b14c7a92d23575eccdfcd7bbb7ef127d1bad)
@@ -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 f941b14c7a92d23575eccdfcd7bbb7ef127d1bad)
+++ src/Actions/MoleculeAction/SuspendInWaterAction.hpp	(revision f941b14c7a92d23575eccdfcd7bbb7ef127d1bad)
@@ -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 f941b14c7a92d23575eccdfcd7bbb7ef127d1bad)
+++ src/Actions/MoleculeAction/TranslateAction.cpp	(revision f941b14c7a92d23575eccdfcd7bbb7ef127d1bad)
@@ -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 f941b14c7a92d23575eccdfcd7bbb7ef127d1bad)
+++ src/Actions/MoleculeAction/TranslateAction.hpp	(revision f941b14c7a92d23575eccdfcd7bbb7ef127d1bad)
@@ -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 f941b14c7a92d23575eccdfcd7bbb7ef127d1bad)
+++ src/Actions/MoleculeAction/VerletIntegrationAction.cpp	(revision f941b14c7a92d23575eccdfcd7bbb7ef127d1bad)
@@ -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 f941b14c7a92d23575eccdfcd7bbb7ef127d1bad)
+++ src/Actions/MoleculeAction/VerletIntegrationAction.hpp	(revision f941b14c7a92d23575eccdfcd7bbb7ef127d1bad)
@@ -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
Index: src/Actions/ParserAction/LoadXyzAction.cpp
===================================================================
--- src/Actions/ParserAction/LoadXyzAction.cpp	(revision f941b14c7a92d23575eccdfcd7bbb7ef127d1bad)
+++ src/Actions/ParserAction/LoadXyzAction.cpp	(revision f941b14c7a92d23575eccdfcd7bbb7ef127d1bad)
@@ -0,0 +1,89 @@
+/*
+ * LoadXyzAction.cpp
+ *
+ *  Created on: May 8, 2010
+ *      Author: heber
+ */
+
+#include "Actions/ParserAction/LoadXyzAction.hpp"
+#include "Parser/XyzParser.hpp"
+
+#include <iostream>
+#include <string>
+
+using namespace std;
+
+#include "UIElements/UIFactory.hpp"
+#include "UIElements/Dialog.hpp"
+#include "Actions/MapOfActions.hpp"
+
+#include "atom.hpp"
+#include "molecule.hpp"
+
+/****** ParserLoadXyzAction *****/
+
+//// memento to remember the state when undoing
+//
+//class ParserLoadXyzState : public ActionState {
+//public:
+//  ParserLoadXyzState(molecule* _mol,std::string _lastName) :
+//    mol(_mol),
+//    lastName(_lastName)
+//  {}
+//  molecule* mol;
+//  std::string lastName;
+//};
+
+const char ParserLoadXyzAction::NAME[] = "LoadXyz";
+
+ParserLoadXyzAction::ParserLoadXyzAction() :
+  Action(NAME)
+{}
+
+ParserLoadXyzAction::~ParserLoadXyzAction()
+{}
+
+Action::state_ptr ParserLoadXyzAction::performCall() {
+  string filename;
+  XyzParser parser;
+  Dialog *dialog = UIFactory::getInstance().makeDialog();
+
+  dialog->queryString("filename",&filename, "Filename of the xyz file");
+
+  if(dialog->display()) {
+    // parse xyz file
+    ifstream input;
+    input.open(filename.c_str());
+    if (!input.fail())
+      parser.load(&input);
+    input.close();
+  }
+  delete dialog;
+  return Action::failure;
+}
+
+Action::state_ptr ParserLoadXyzAction::performUndo(Action::state_ptr _state) {
+//  ParserLoadXyzState *state = assert_cast<ParserLoadXyzState*>(_state.get());
+
+  return Action::failure;
+//  string newName = state->mol->getName();
+//  state->mol->setName(state->lastName);
+//
+//  return Action::state_ptr(new ParserLoadXyzState(state->mol,newName));
+}
+
+Action::state_ptr ParserLoadXyzAction::performRedo(Action::state_ptr _state){
+  return Action::failure;
+}
+
+bool ParserLoadXyzAction::canUndo() {
+  return false;
+}
+
+bool ParserLoadXyzAction::shouldUndo() {
+  return false;
+}
+
+const string ParserLoadXyzAction::getName() {
+  return NAME;
+}
Index: src/Actions/ParserAction/LoadXyzAction.hpp
===================================================================
--- src/Actions/ParserAction/LoadXyzAction.hpp	(revision f941b14c7a92d23575eccdfcd7bbb7ef127d1bad)
+++ src/Actions/ParserAction/LoadXyzAction.hpp	(revision f941b14c7a92d23575eccdfcd7bbb7ef127d1bad)
@@ -0,0 +1,31 @@
+/*
+ * LoadXyzAction.hpp
+ *
+ *  Created on: May 8, 2010
+ *      Author: heber
+ */
+
+#ifndef LOADXYZACTION_HPP_
+#define LOADXYZACTION_HPP_
+
+#include "Actions/Action.hpp"
+#include "Actions/Process.hpp"
+
+class ParserLoadXyzAction : public Action {
+public:
+  ParserLoadXyzAction();
+  virtual ~ParserLoadXyzAction();
+
+  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 /* LOADXYZACTION_HPP_ */
Index: src/Actions/ParserAction/SaveXyzAction.cpp
===================================================================
--- src/Actions/ParserAction/SaveXyzAction.cpp	(revision f941b14c7a92d23575eccdfcd7bbb7ef127d1bad)
+++ src/Actions/ParserAction/SaveXyzAction.cpp	(revision f941b14c7a92d23575eccdfcd7bbb7ef127d1bad)
@@ -0,0 +1,91 @@
+/*
+ * SaveXyzAction.cpp
+ *
+ *  Created on: May 8, 2010
+ *      Author: heber
+ */
+
+#include "Actions/ParserAction/SaveXyzAction.hpp"
+#include "Parser/XyzParser.hpp"
+
+#include <iostream>
+#include <string>
+
+using namespace std;
+
+#include "UIElements/UIFactory.hpp"
+#include "UIElements/Dialog.hpp"
+#include "Actions/MapOfActions.hpp"
+
+#include "atom.hpp"
+#include "molecule.hpp"
+
+/****** ParserSaveXyzAction *****/
+
+//// memento to remember the state when undoing
+//
+//class ParserSaveXyzState : public ActionState {
+//public:
+//  ParserSaveXyzState(molecule* _mol,std::string _lastName) :
+//    mol(_mol),
+//    lastName(_lastName)
+//  {}
+//  molecule* mol;
+//  std::string lastName;
+//};
+
+const char ParserSaveXyzAction::NAME[] = "SaveXyz";
+
+ParserSaveXyzAction::ParserSaveXyzAction() :
+  Action(NAME)
+{}
+
+ParserSaveXyzAction::~ParserSaveXyzAction()
+{}
+
+Action::state_ptr ParserSaveXyzAction::performCall() {
+  string filename;
+  XyzParser parser;
+  Dialog *dialog = UIFactory::getInstance().makeDialog();
+
+  dialog->queryString("filename",&filename, "Filename of the xyz file");
+
+  if(dialog->display()) {
+    // store xyz file
+    ofstream output;
+    output.open(filename.c_str());
+    if (!output.fail())
+      parser.save(&output);
+    output.close();
+  }
+  delete dialog;
+  return Action::failure;
+}
+
+Action::state_ptr ParserSaveXyzAction::performUndo(Action::state_ptr _state) {
+//  ParserSaveXyzState *state = assert_cast<ParserSaveXyzState*>(_state.get());
+
+  return Action::failure;
+//  string newName = state->mol->getName();
+//  state->mol->setName(state->lastName);
+//
+//  return Action::state_ptr(new ParserSaveXyzState(state->mol,newName));
+}
+
+Action::state_ptr ParserSaveXyzAction::performRedo(Action::state_ptr _state){
+  return Action::failure;
+//  // Undo and redo have to do the same for this action
+//  return performUndo(_state);
+}
+
+bool ParserSaveXyzAction::canUndo() {
+  return false;
+}
+
+bool ParserSaveXyzAction::shouldUndo() {
+  return false;
+}
+
+const string ParserSaveXyzAction::getName() {
+  return NAME;
+}
Index: src/Actions/ParserAction/SaveXyzAction.hpp
===================================================================
--- src/Actions/ParserAction/SaveXyzAction.hpp	(revision f941b14c7a92d23575eccdfcd7bbb7ef127d1bad)
+++ src/Actions/ParserAction/SaveXyzAction.hpp	(revision f941b14c7a92d23575eccdfcd7bbb7ef127d1bad)
@@ -0,0 +1,31 @@
+/*
+ * SaveXyzAction.hpp
+ *
+ *  Created on: May 8, 2010
+ *      Author: heber
+ */
+
+#ifndef SAVEXYZACTION_HPP_
+#define SAVEXYZACTION_HPP_
+
+#include "Actions/Action.hpp"
+#include "Actions/Process.hpp"
+
+class ParserSaveXyzAction : public Action {
+public:
+  ParserSaveXyzAction();
+  virtual ~ParserSaveXyzAction();
+
+  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 /* SAVEXYZACTION_HPP_ */
Index: src/Actions/TesselationAction/ConvexEnvelopeAction.cpp
===================================================================
--- src/Actions/TesselationAction/ConvexEnvelopeAction.cpp	(revision f941b14c7a92d23575eccdfcd7bbb7ef127d1bad)
+++ src/Actions/TesselationAction/ConvexEnvelopeAction.cpp	(revision f941b14c7a92d23575eccdfcd7bbb7ef127d1bad)
@@ -0,0 +1,109 @@
+/*
+ * ConvexEnvelopeAction.cpp
+ *
+ *  Created on: May 12, 2010
+ *      Author: heber
+ */
+
+#include "Actions/TesselationAction/ConvexEnvelopeAction.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 "linkedcell.hpp"
+#include "log.hpp"
+#include "molecule.hpp"
+#include "verbose.hpp"
+#include "World.hpp"
+
+/****** TesselationConvexEnvelopeAction *****/
+
+// memento to remember the state when undoing
+
+//class TesselationConvexEnvelopeState : public ActionState {
+//public:
+//  TesselationConvexEnvelopeState(molecule* _mol,std::string _lastName) :
+//    mol(_mol),
+//    lastName(_lastName)
+//  {}
+//  molecule* mol;
+//  std::string lastName;
+//};
+
+const char TesselationConvexEnvelopeAction::NAME[] = "convex-envelope";
+
+TesselationConvexEnvelopeAction::TesselationConvexEnvelopeAction() :
+  Action(NAME)
+{}
+
+TesselationConvexEnvelopeAction::~TesselationConvexEnvelopeAction()
+{}
+
+Action::state_ptr TesselationConvexEnvelopeAction::performCall() {
+  string filenameConvex;
+  string filenameNonConvex;
+  Dialog *dialog = UIFactory::getInstance().makeDialog();
+  molecule * mol = NULL;
+  bool Success = false;
+
+  dialog->queryMolecule(NAME, &mol, MapOfActions::getInstance().getDescription(NAME));
+  dialog->queryString("output", &filenameConvex, MapOfActions::getInstance().getDescription("output"));
+  dialog->queryString("output", &filenameNonConvex, MapOfActions::getInstance().getDescription("output"));
+
+  if(dialog->display()) {
+    class Tesselation *TesselStruct = NULL;
+    const LinkedCell *LCList = NULL;
+    DoLog(0) && (Log() << Verbose(0) << "Evaluating volume of the convex envelope.");
+    DoLog(1) && (Log() << Verbose(1) << "Storing tecplot convex data in " << filenameConvex << "." << endl);
+    DoLog(1) && (Log() << Verbose(1) << "Storing tecplot non-convex data in " << filenameNonConvex << "." << endl);
+    LCList = new LinkedCell(mol, 100.);
+    //FindConvexBorder(mol, LCList, argv[argptr]);
+    // TODO: Beide Funktionen sollten streams anstelle des Filenamen benutzen, besser fuer unit tests
+    FindNonConvexBorder(mol, TesselStruct, LCList, 50., filenameNonConvex.c_str());
+    //RemoveAllBoundaryPoints(TesselStruct, mol, argv[argptr]);
+    ConvexizeNonconvexEnvelope(TesselStruct, mol, filenameConvex.c_str());
+    delete(TesselStruct);
+    delete(LCList);
+    delete dialog;
+    if (Success)
+      return Action::success;
+    else
+      return Action::failure;
+  }
+  delete dialog;
+  return Action::failure;
+}
+
+Action::state_ptr TesselationConvexEnvelopeAction::performUndo(Action::state_ptr _state) {
+//  TesselationConvexEnvelopeState *state = assert_cast<TesselationConvexEnvelopeState*>(_state.get());
+
+//  string newName = state->mol->getName();
+//  state->mol->setName(state->lastName);
+
+  return Action::failure;
+}
+
+Action::state_ptr TesselationConvexEnvelopeAction::performRedo(Action::state_ptr _state){
+  // Undo and redo have to do the same for this action
+  return performUndo(_state);
+}
+
+bool TesselationConvexEnvelopeAction::canUndo() {
+  return false;
+}
+
+bool TesselationConvexEnvelopeAction::shouldUndo() {
+  return false;
+}
+
+const string TesselationConvexEnvelopeAction::getName() {
+  return NAME;
+}
Index: src/Actions/TesselationAction/ConvexEnvelopeAction.hpp
===================================================================
--- src/Actions/TesselationAction/ConvexEnvelopeAction.hpp	(revision f941b14c7a92d23575eccdfcd7bbb7ef127d1bad)
+++ src/Actions/TesselationAction/ConvexEnvelopeAction.hpp	(revision f941b14c7a92d23575eccdfcd7bbb7ef127d1bad)
@@ -0,0 +1,34 @@
+/*
+ * ConvexEnvelopeAction.hpp
+ *
+ *  Created on: May 12, 2010
+ *      Author: heber
+ */
+
+#ifndef CONVEXENVELOPEACTION_HPP
+#define CONVEXENVELOPEACTION_HPP
+
+#include "Actions/Action.hpp"
+#include "Actions/Process.hpp"
+
+class TesselationListClass;
+
+class TesselationConvexEnvelopeAction : public Action {
+public:
+  TesselationConvexEnvelopeAction();
+  virtual ~TesselationConvexEnvelopeAction();
+
+  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 // CONVEXENVELOPEACTION_HPP
Index: src/Actions/TesselationAction/NonConvexEnvelopeAction.cpp
===================================================================
--- src/Actions/TesselationAction/NonConvexEnvelopeAction.cpp	(revision f941b14c7a92d23575eccdfcd7bbb7ef127d1bad)
+++ src/Actions/TesselationAction/NonConvexEnvelopeAction.cpp	(revision f941b14c7a92d23575eccdfcd7bbb7ef127d1bad)
@@ -0,0 +1,110 @@
+/*
+ * NonConvexEnvelopeAction.cpp
+ *
+ *  Created on: May 10, 2010
+ *      Author: heber
+ */
+
+#include "Actions/TesselationAction/NonConvexEnvelopeAction.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 "linkedcell.hpp"
+#include "log.hpp"
+#include "molecule.hpp"
+#include "verbose.hpp"
+#include "World.hpp"
+
+/****** TesselationNonConvexEnvelopeAction *****/
+
+// memento to remember the state when undoing
+
+//class TesselationNonConvexEnvelopeState : public ActionState {
+//public:
+//  TesselationNonConvexEnvelopeState(molecule* _mol,std::string _lastName) :
+//    mol(_mol),
+//    lastName(_lastName)
+//  {}
+//  molecule* mol;
+//  std::string lastName;
+//};
+
+const char TesselationNonConvexEnvelopeAction::NAME[] = "nonconvex-envelope";
+
+TesselationNonConvexEnvelopeAction::TesselationNonConvexEnvelopeAction() :
+  Action(NAME)
+{}
+
+TesselationNonConvexEnvelopeAction::~TesselationNonConvexEnvelopeAction()
+{}
+
+Action::state_ptr TesselationNonConvexEnvelopeAction::performCall() {
+  string filename;
+  Dialog *dialog = UIFactory::getInstance().makeDialog();
+  molecule * Boundary = NULL;
+  double SphereRadius = 0;
+  bool Success = false;
+  clock_t start,end;
+
+  dialog->queryDouble(NAME, &SphereRadius, MapOfActions::getInstance().getDescription(NAME));
+  dialog->queryString("output", &filename, MapOfActions::getInstance().getDescription("output"));
+  dialog->queryMolecule("molecule-by-id", &Boundary, MapOfActions::getInstance().getDescription("molecule-by-id"));
+
+  if(dialog->display()) {
+    class Tesselation *T = NULL;
+    const LinkedCell *LCList = NULL;
+    DoLog(0) && (Log() << Verbose(0) << "Evaluating non-convex envelope of molecule." << Boundary->getId() << endl);
+    DoLog(1) && (Log() << Verbose(1) << "Using rolling ball of radius " << SphereRadius << " and storing tecplot data in " << filename << "." << endl);
+    DoLog(1) && (Log() << Verbose(1) << "Specified molecule has " << Boundary->AtomCount << " atoms." << endl);
+    start = clock();
+    LCList = new LinkedCell(Boundary, SphereRadius*2.);
+    Success = FindNonConvexBorder(Boundary, T, LCList, SphereRadius, filename.c_str());
+    //FindDistributionOfEllipsoids(T, &LCList, N, number, filename.c_str());
+    end = clock();
+    DoLog(0) && (Log() << Verbose(0) << "Clocks for this operation: " << (end-start) << ", time: " << ((double)(end-start)/CLOCKS_PER_SEC) << "s." << endl);
+    delete(LCList);
+    delete(T);
+    delete dialog;
+    if (Success)
+      return Action::success;
+    else
+      return Action::failure;
+  }
+  delete dialog;
+  return Action::failure;
+}
+
+Action::state_ptr TesselationNonConvexEnvelopeAction::performUndo(Action::state_ptr _state) {
+//  TesselationNonConvexEnvelopeState *state = assert_cast<TesselationNonConvexEnvelopeState*>(_state.get());
+
+//  string newName = state->mol->getName();
+//  state->mol->setName(state->lastName);
+
+  return Action::failure;
+}
+
+Action::state_ptr TesselationNonConvexEnvelopeAction::performRedo(Action::state_ptr _state){
+  // Undo and redo have to do the same for this action
+  return performUndo(_state);
+}
+
+bool TesselationNonConvexEnvelopeAction::canUndo() {
+  return false;
+}
+
+bool TesselationNonConvexEnvelopeAction::shouldUndo() {
+  return false;
+}
+
+const string TesselationNonConvexEnvelopeAction::getName() {
+  return NAME;
+}
Index: src/Actions/TesselationAction/NonConvexEnvelopeAction.hpp
===================================================================
--- src/Actions/TesselationAction/NonConvexEnvelopeAction.hpp	(revision f941b14c7a92d23575eccdfcd7bbb7ef127d1bad)
+++ src/Actions/TesselationAction/NonConvexEnvelopeAction.hpp	(revision f941b14c7a92d23575eccdfcd7bbb7ef127d1bad)
@@ -0,0 +1,34 @@
+/*
+ * NonConvexEnvelopeAction.hpp
+ *
+ *  Created on: May 10, 2010
+ *      Author: heber
+ */
+
+#ifndef NONCONVEXENVELOPEACTION_HPP
+#define NONCONVEXENVELOPEACTION_HPP
+
+#include "Actions/Action.hpp"
+#include "Actions/Process.hpp"
+
+class TesselationListClass;
+
+class TesselationNonConvexEnvelopeAction : public Action {
+public:
+  TesselationNonConvexEnvelopeAction();
+  virtual ~TesselationNonConvexEnvelopeAction();
+
+  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 // NONCONVEXENVELOPEACTION_HPP
Index: src/Actions/WorldAction/AddEmptyBoundaryAction.cpp
===================================================================
--- src/Actions/WorldAction/AddEmptyBoundaryAction.cpp	(revision f941b14c7a92d23575eccdfcd7bbb7ef127d1bad)
+++ src/Actions/WorldAction/AddEmptyBoundaryAction.cpp	(revision f941b14c7a92d23575eccdfcd7bbb7ef127d1bad)
@@ -0,0 +1,104 @@
+/*
+ * AddEmptyBoundaryAction.cpp
+ *
+ *  Created on: May 8, 2010
+ *      Author: heber
+ */
+
+#include "Actions/WorldAction/AddEmptyBoundaryAction.hpp"
+#include "CommandLineParser.hpp"
+#include "atom.hpp"
+#include "log.hpp"
+#include "vector.hpp"
+#include "World.hpp"
+
+#include <iostream>
+#include <string>
+#include <vector>
+
+using namespace std;
+
+#include "UIElements/UIFactory.hpp"
+#include "UIElements/Dialog.hpp"
+#include "Actions/MapOfActions.hpp"
+#include "Helpers/Assert.hpp"
+
+const char WorldAddEmptyBoundaryAction::NAME[] = "boundary";
+
+WorldAddEmptyBoundaryAction::WorldAddEmptyBoundaryAction() :
+  Action(NAME)
+{}
+
+WorldAddEmptyBoundaryAction::~WorldAddEmptyBoundaryAction()
+{}
+
+Action::state_ptr WorldAddEmptyBoundaryAction::performCall() {
+  Dialog *dialog = UIFactory::getInstance().makeDialog();
+  Vector boundary;
+  Vector Min;
+  Vector Max;
+  int j=0;
+
+  dialog->queryVector(NAME, &boundary, World::getInstance().getDomain(), false, MapOfActions::getInstance().getDescription(NAME));
+
+  if(dialog->display()) {
+    // get maximum and minimum
+    vector<atom *> AllAtoms = World::getInstance().getAllAtoms();
+    ASSERT(AllAtoms.size() > 0, "There must be atoms present for AddingEmptyBoundary.");
+    vector<atom *>::iterator AtomRunner = AllAtoms.begin();
+    Min = (*AtomRunner)->x;
+    Max = (*AtomRunner)->x;
+    for (; AtomRunner != AllAtoms.end(); ++AtomRunner) {
+      for (int i=0;i<NDIM;i++) {
+        if ((*AtomRunner)->x[i] > Max[i])
+          Max[i] = (*AtomRunner)->x[i];
+        if ((*AtomRunner)->x[i] < Min[i])
+          Min[i] = (*AtomRunner)->x[i];
+      }
+    }
+    // set new box size
+    double * const cell_size = World::getInstance().getDomain();
+    for (j=0;j<6;j++)
+      cell_size[j] = 0.;
+    j=-1;
+    for (int i=0;i<NDIM;i++) {
+      j += i+1;
+      cell_size[j] = (Max[i]-Min[i]+2.*boundary[i]);
+    }
+    // translate all atoms, such that Min is aty (0,0,0)
+    AtomRunner = AllAtoms.begin();
+    for (; AtomRunner != AllAtoms.end(); ++AtomRunner)
+      (*AtomRunner)->x -= Min;
+    delete dialog;
+    return Action::success;
+  } else {
+    delete dialog;
+    return Action::failure;
+  }
+}
+
+Action::state_ptr WorldAddEmptyBoundaryAction::performUndo(Action::state_ptr _state) {
+//  ParserLoadXyzState *state = assert_cast<ParserLoadXyzState*>(_state.get());
+
+  return Action::failure;
+//  string newName = state->mol->getName();
+//  state->mol->setName(state->lastName);
+//
+//  return Action::state_ptr(new ParserLoadXyzState(state->mol,newName));
+}
+
+Action::state_ptr WorldAddEmptyBoundaryAction::performRedo(Action::state_ptr _state){
+  return Action::failure;
+}
+
+bool WorldAddEmptyBoundaryAction::canUndo() {
+  return false;
+}
+
+bool WorldAddEmptyBoundaryAction::shouldUndo() {
+  return false;
+}
+
+const string WorldAddEmptyBoundaryAction::getName() {
+  return NAME;
+}
Index: src/Actions/WorldAction/AddEmptyBoundaryAction.hpp
===================================================================
--- src/Actions/WorldAction/AddEmptyBoundaryAction.hpp	(revision f941b14c7a92d23575eccdfcd7bbb7ef127d1bad)
+++ src/Actions/WorldAction/AddEmptyBoundaryAction.hpp	(revision f941b14c7a92d23575eccdfcd7bbb7ef127d1bad)
@@ -0,0 +1,30 @@
+/*
+ * AddEmptyBoundaryAction.hpp
+ *
+ *  Created on: May 8, 2010
+ *      Author: heber
+ */
+
+#ifndef ADDEMPTYBOUNDARYACTION_HPP_
+#define ADDEMPTYBOUNDARYACTION_HPP_
+
+#include "Actions/Action.hpp"
+
+class WorldAddEmptyBoundaryAction : public Action {
+public:
+  WorldAddEmptyBoundaryAction();
+  virtual ~WorldAddEmptyBoundaryAction();
+
+  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 /* ADDEMPTYBOUNDARYACTION_HPP_ */
Index: src/Actions/WorldAction/BoundInBoxAction.cpp
===================================================================
--- src/Actions/WorldAction/BoundInBoxAction.cpp	(revision f941b14c7a92d23575eccdfcd7bbb7ef127d1bad)
+++ src/Actions/WorldAction/BoundInBoxAction.cpp	(revision f941b14c7a92d23575eccdfcd7bbb7ef127d1bad)
@@ -0,0 +1,76 @@
+/*
+ * BoundInBoxAction.cpp
+ *
+ *  Created on: May 8, 2010
+ *      Author: heber
+ */
+
+#include "Actions/WorldAction/BoundInBoxAction.hpp"
+#include "CommandLineParser.hpp"
+#include "log.hpp"
+#include "molecule.hpp"
+#include "World.hpp"
+
+#include <iostream>
+#include <string>
+#include <vector>
+
+using namespace std;
+
+#include "UIElements/UIFactory.hpp"
+#include "UIElements/Dialog.hpp"
+#include "Actions/MapOfActions.hpp"
+
+const char WorldBoundInBoxAction::NAME[] = "bound-in-box";
+
+WorldBoundInBoxAction::WorldBoundInBoxAction() :
+  Action(NAME)
+{}
+
+WorldBoundInBoxAction::~WorldBoundInBoxAction()
+{}
+
+Action::state_ptr WorldBoundInBoxAction::performCall() {
+  Dialog *dialog = UIFactory::getInstance().makeDialog();
+
+  dialog->queryEmpty(NAME, MapOfActions::getInstance().getDescription(NAME));
+
+  if(dialog->display()) {
+    // center
+    vector<molecule*> AllMolecules = World::getInstance().getAllMolecules();
+    for (vector<molecule*>::iterator MolRunner = AllMolecules.begin(); MolRunner != AllMolecules.end(); ++MolRunner) {
+      (*MolRunner)->BoundInBox();
+    }
+    delete dialog;
+    return Action::success;
+  } else {
+    delete dialog;
+    return Action::failure;
+  }
+}
+
+Action::state_ptr WorldBoundInBoxAction::performUndo(Action::state_ptr _state) {
+//  ParserLoadXyzState *state = assert_cast<ParserLoadXyzState*>(_state.get());
+
+  return Action::failure;
+//  string newName = state->mol->getName();
+//  state->mol->setName(state->lastName);
+//
+//  return Action::state_ptr(new ParserLoadXyzState(state->mol,newName));
+}
+
+Action::state_ptr WorldBoundInBoxAction::performRedo(Action::state_ptr _state){
+  return Action::failure;
+}
+
+bool WorldBoundInBoxAction::canUndo() {
+  return false;
+}
+
+bool WorldBoundInBoxAction::shouldUndo() {
+  return false;
+}
+
+const string WorldBoundInBoxAction::getName() {
+  return NAME;
+}
Index: src/Actions/WorldAction/BoundInBoxAction.hpp
===================================================================
--- src/Actions/WorldAction/BoundInBoxAction.hpp	(revision f941b14c7a92d23575eccdfcd7bbb7ef127d1bad)
+++ src/Actions/WorldAction/BoundInBoxAction.hpp	(revision f941b14c7a92d23575eccdfcd7bbb7ef127d1bad)
@@ -0,0 +1,30 @@
+/*
+ * BoundInBoxAction.hpp
+ *
+ *  Created on: May 8, 2010
+ *      Author: heber
+ */
+
+#ifndef BOUNDINBOXACTION_HPP_
+#define BOUNDINBOXACTION_HPP_
+
+#include "Actions/Action.hpp"
+
+class WorldBoundInBoxAction : public Action {
+public:
+  WorldBoundInBoxAction();
+  virtual ~WorldBoundInBoxAction();
+
+  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 /* BOUNDINBOXACTION_HPP_ */
Index: src/Actions/WorldAction/CenterInBoxAction.cpp
===================================================================
--- src/Actions/WorldAction/CenterInBoxAction.cpp	(revision f941b14c7a92d23575eccdfcd7bbb7ef127d1bad)
+++ src/Actions/WorldAction/CenterInBoxAction.cpp	(revision f941b14c7a92d23575eccdfcd7bbb7ef127d1bad)
@@ -0,0 +1,75 @@
+/*
+ * CenterInBoxAction.cpp
+ *
+ *  Created on: May 8, 2010
+ *      Author: heber
+ */
+
+#include "Actions/WorldAction/CenterInBoxAction.hpp"
+#include "CommandLineParser.hpp"
+#include "log.hpp"
+#include "molecule.hpp"
+#include "World.hpp"
+
+#include <iostream>
+#include <string>
+
+using namespace std;
+
+#include "UIElements/UIFactory.hpp"
+#include "UIElements/Dialog.hpp"
+#include "Actions/MapOfActions.hpp"
+
+const char WorldCenterInBoxAction::NAME[] = "center-in-box";
+
+WorldCenterInBoxAction::WorldCenterInBoxAction() :
+  Action(NAME)
+{}
+
+WorldCenterInBoxAction::~WorldCenterInBoxAction()
+{}
+
+Action::state_ptr WorldCenterInBoxAction::performCall() {
+  Dialog *dialog = UIFactory::getInstance().makeDialog();
+
+  dialog->queryEmpty(NAME, MapOfActions::getInstance().getDescription(NAME));
+
+  if(dialog->display()) {
+    // center
+    vector<molecule *> AllMolecules = World::getInstance().getAllMolecules();
+    for (vector<molecule*>::iterator MolRunner = AllMolecules.begin(); MolRunner != AllMolecules.end(); ++MolRunner) {
+      (*MolRunner)->CenterInBox();
+    }
+    delete dialog;
+    return Action::success;
+  } else {
+    delete dialog;
+    return Action::failure;
+  }
+}
+
+Action::state_ptr WorldCenterInBoxAction::performUndo(Action::state_ptr _state) {
+//  ParserLoadXyzState *state = assert_cast<ParserLoadXyzState*>(_state.get());
+
+  return Action::failure;
+//  string newName = state->mol->getName();
+//  state->mol->setName(state->lastName);
+//
+//  return Action::state_ptr(new ParserLoadXyzState(state->mol,newName));
+}
+
+Action::state_ptr WorldCenterInBoxAction::performRedo(Action::state_ptr _state){
+  return Action::failure;
+}
+
+bool WorldCenterInBoxAction::canUndo() {
+  return false;
+}
+
+bool WorldCenterInBoxAction::shouldUndo() {
+  return false;
+}
+
+const string WorldCenterInBoxAction::getName() {
+  return NAME;
+}
Index: src/Actions/WorldAction/CenterInBoxAction.hpp
===================================================================
--- src/Actions/WorldAction/CenterInBoxAction.hpp	(revision f941b14c7a92d23575eccdfcd7bbb7ef127d1bad)
+++ src/Actions/WorldAction/CenterInBoxAction.hpp	(revision f941b14c7a92d23575eccdfcd7bbb7ef127d1bad)
@@ -0,0 +1,30 @@
+/*
+ * CenterInBoxAction.hpp
+ *
+ *  Created on: May 8, 2010
+ *      Author: heber
+ */
+
+#ifndef CENTERINBOXACTION_HPP_
+#define CENTERINBOXACTION_HPP_
+
+#include "Actions/Action.hpp"
+
+class WorldCenterInBoxAction : public Action {
+public:
+  WorldCenterInBoxAction();
+  virtual ~WorldCenterInBoxAction();
+
+  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 /* CENTERINBOXACTION_HPP_ */
Index: src/Actions/WorldAction/CenterOnEdgeAction.cpp
===================================================================
--- src/Actions/WorldAction/CenterOnEdgeAction.cpp	(revision f941b14c7a92d23575eccdfcd7bbb7ef127d1bad)
+++ src/Actions/WorldAction/CenterOnEdgeAction.cpp	(revision f941b14c7a92d23575eccdfcd7bbb7ef127d1bad)
@@ -0,0 +1,101 @@
+/*
+ * CenterOnEdgeAction.cpp
+ *
+ *  Created on: May 8, 2010
+ *      Author: heber
+ */
+
+#include "Actions/WorldAction/CenterOnEdgeAction.hpp"
+#include "CommandLineParser.hpp"
+#include "atom.hpp"
+#include "log.hpp"
+#include "vector.hpp"
+#include "World.hpp"
+
+#include <iostream>
+#include <string>
+
+using namespace std;
+
+#include "UIElements/UIFactory.hpp"
+#include "UIElements/Dialog.hpp"
+#include "Actions/MapOfActions.hpp"
+#include "Helpers/Assert.hpp"
+
+const char WorldCenterOnEdgeAction::NAME[] = "center-edge";
+
+WorldCenterOnEdgeAction::WorldCenterOnEdgeAction() :
+  Action(NAME)
+{}
+
+WorldCenterOnEdgeAction::~WorldCenterOnEdgeAction()
+{}
+
+Action::state_ptr WorldCenterOnEdgeAction::performCall() {
+  Dialog *dialog = UIFactory::getInstance().makeDialog();
+  Vector Min;
+  Vector Max;
+  int j=0;
+
+  dialog->queryEmpty(NAME, MapOfActions::getInstance().getDescription(NAME));
+
+  if(dialog->display()) {
+    // get maximum and minimum
+    vector<atom *> AllAtoms = World::getInstance().getAllAtoms();
+    ASSERT(AllAtoms.size() > 0, "For CenteronEdge atoms must be present.");
+    vector<atom *>::iterator AtomRunner = AllAtoms.begin();
+    Min = (*AtomRunner)->x;
+    Max = (*AtomRunner)->x;
+    for (; AtomRunner != AllAtoms.end(); ++AtomRunner) {
+      for (int i=0;i<NDIM;i++) {
+        if ((*AtomRunner)->x[i] > Max[i])
+          Max[i] = (*AtomRunner)->x[i];
+        if ((*AtomRunner)->x[i] < Min[i])
+          Min[i] = (*AtomRunner)->x[i];
+      }
+    }
+    // set new box size
+    double * const cell_size = World::getInstance().getDomain();
+    for (j=0;j<6;j++)
+      cell_size[j] = 0.;
+    j=-1;
+    for (int i=0;i<NDIM;i++) {
+      j += i+1;
+      cell_size[j] = (Max[i]-Min[i]);
+    }
+    // translate all atoms, such that Min is aty (0,0,0)
+    for (vector<atom*>::iterator AtomRunner = AllAtoms.begin(); AtomRunner != AllAtoms.end(); ++AtomRunner)
+      (*AtomRunner)->x -= Min;
+    delete dialog;
+    return Action::success;
+  } else {
+    delete dialog;
+    return Action::failure;
+  }
+}
+
+Action::state_ptr WorldCenterOnEdgeAction::performUndo(Action::state_ptr _state) {
+//  ParserLoadXyzState *state = assert_cast<ParserLoadXyzState*>(_state.get());
+
+  return Action::failure;
+//  string newName = state->mol->getName();
+//  state->mol->setName(state->lastName);
+//
+//  return Action::state_ptr(new ParserLoadXyzState(state->mol,newName));
+}
+
+Action::state_ptr WorldCenterOnEdgeAction::performRedo(Action::state_ptr _state){
+  return Action::failure;
+}
+
+bool WorldCenterOnEdgeAction::canUndo() {
+  return false;
+}
+
+bool WorldCenterOnEdgeAction::shouldUndo() {
+  return false;
+}
+
+const string WorldCenterOnEdgeAction::getName() {
+  return NAME;
+}
Index: src/Actions/WorldAction/CenterOnEdgeAction.hpp
===================================================================
--- src/Actions/WorldAction/CenterOnEdgeAction.hpp	(revision f941b14c7a92d23575eccdfcd7bbb7ef127d1bad)
+++ src/Actions/WorldAction/CenterOnEdgeAction.hpp	(revision f941b14c7a92d23575eccdfcd7bbb7ef127d1bad)
@@ -0,0 +1,30 @@
+/*
+ * CenterOnEdgeAction.hpp
+ *
+ *  Created on: May 8, 2010
+ *      Author: heber
+ */
+
+#ifndef CENTERONEDGEACTION_HPP_
+#define CENTERONEDGEACTION_HPP_
+
+#include "Actions/Action.hpp"
+
+class WorldCenterOnEdgeAction : public Action {
+public:
+  WorldCenterOnEdgeAction();
+  virtual ~WorldCenterOnEdgeAction();
+
+  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 /* CENTERONEDGEACTION_HPP_ */
Index: src/Actions/WorldAction/ChangeBoxAction.cpp
===================================================================
--- src/Actions/WorldAction/ChangeBoxAction.cpp	(revision f941b14c7a92d23575eccdfcd7bbb7ef127d1bad)
+++ src/Actions/WorldAction/ChangeBoxAction.cpp	(revision f941b14c7a92d23575eccdfcd7bbb7ef127d1bad)
@@ -0,0 +1,72 @@
+/*
+ * ChangeBoxAction.cpp
+ *
+ *  Created on: May 8, 2010
+ *      Author: heber
+ */
+
+#include "Actions/WorldAction/ChangeBoxAction.hpp"
+#include "CommandLineParser.hpp"
+#include "log.hpp"
+#include "verbose.hpp"
+#include "World.hpp"
+
+#include <iostream>
+#include <string>
+
+using namespace std;
+
+#include "UIElements/UIFactory.hpp"
+#include "UIElements/Dialog.hpp"
+#include "Actions/MapOfActions.hpp"
+
+const char WorldChangeBoxAction::NAME[] = "change-box";
+
+WorldChangeBoxAction::WorldChangeBoxAction() :
+  Action(NAME)
+{}
+
+WorldChangeBoxAction::~WorldChangeBoxAction()
+{}
+
+Action::state_ptr WorldChangeBoxAction::performCall() {
+  Dialog *dialog = UIFactory::getInstance().makeDialog();
+
+  double * cell_size = World::getInstance().getDomain();
+  dialog->queryBox(NAME, &cell_size, MapOfActions::getInstance().getDescription(NAME));
+
+  if(dialog->display()) {
+    DoLog(0) && (Log() << Verbose(0) << "Setting box domain to " << cell_size[0] << "," << cell_size[1] << "," << cell_size[2] << "," << cell_size[3] << "," << cell_size[4] << "," << cell_size[5] << "," << endl);
+    delete dialog;
+    return Action::success;
+  } else {
+    delete dialog;
+    return Action::failure;
+  }
+}
+
+Action::state_ptr WorldChangeBoxAction::performUndo(Action::state_ptr _state) {
+//  ParserLoadXyzState *state = assert_cast<ParserLoadXyzState*>(_state.get());
+
+  return Action::failure;
+//  string newName = state->mol->getName();
+//  state->mol->setName(state->lastName);
+//
+//  return Action::state_ptr(new ParserLoadXyzState(state->mol,newName));
+}
+
+Action::state_ptr WorldChangeBoxAction::performRedo(Action::state_ptr _state){
+  return Action::failure;
+}
+
+bool WorldChangeBoxAction::canUndo() {
+  return false;
+}
+
+bool WorldChangeBoxAction::shouldUndo() {
+  return false;
+}
+
+const string WorldChangeBoxAction::getName() {
+  return NAME;
+}
Index: src/Actions/WorldAction/ChangeBoxAction.hpp
===================================================================
--- src/Actions/WorldAction/ChangeBoxAction.hpp	(revision f941b14c7a92d23575eccdfcd7bbb7ef127d1bad)
+++ src/Actions/WorldAction/ChangeBoxAction.hpp	(revision f941b14c7a92d23575eccdfcd7bbb7ef127d1bad)
@@ -0,0 +1,30 @@
+/*
+ * ChangeBoxAction.hpp
+ *
+ *  Created on: May 8, 2010
+ *      Author: heber
+ */
+
+#ifndef CHANGEBOXACTION_HPP_
+#define CHANGEBOXACTION_HPP_
+
+#include "Actions/Action.hpp"
+
+class WorldChangeBoxAction : public Action {
+public:
+  WorldChangeBoxAction();
+  virtual ~WorldChangeBoxAction();
+
+  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 /* CHANGEBOXACTION_HPP_ */
Index: src/Actions/WorldAction/RemoveSphereOfAtomsAction.cpp
===================================================================
--- src/Actions/WorldAction/RemoveSphereOfAtomsAction.cpp	(revision f941b14c7a92d23575eccdfcd7bbb7ef127d1bad)
+++ src/Actions/WorldAction/RemoveSphereOfAtomsAction.cpp	(revision f941b14c7a92d23575eccdfcd7bbb7ef127d1bad)
@@ -0,0 +1,87 @@
+/*
+ * RemoveSphereOfAtomsAction.cpp
+ *
+ *  Created on: May 12, 2010
+ *      Author: heber
+ */
+
+#include "Actions/WorldAction/RemoveSphereOfAtomsAction.hpp"
+#include "CommandLineParser.hpp"
+#include "atom.hpp"
+#include "Descriptors/AtomDescriptor.hpp"
+#include "log.hpp"
+#include "vector.hpp"
+#include "verbose.hpp"
+#include "World.hpp"
+
+#include <iostream>
+#include <string>
+
+using namespace std;
+
+#include "UIElements/UIFactory.hpp"
+#include "UIElements/Dialog.hpp"
+#include "Actions/MapOfActions.hpp"
+
+const char WorldRemoveSphereOfAtomsAction::NAME[] = "remove-sphere";
+
+WorldRemoveSphereOfAtomsAction::WorldRemoveSphereOfAtomsAction() :
+  Action(NAME)
+{}
+
+WorldRemoveSphereOfAtomsAction::~WorldRemoveSphereOfAtomsAction()
+{}
+
+Action::state_ptr WorldRemoveSphereOfAtomsAction::performCall() {
+  Dialog *dialog = UIFactory::getInstance().makeDialog();
+  double radius = 0.;
+  atom *first = NULL;
+
+  dialog->queryDouble(NAME, &radius, MapOfActions::getInstance().getDescription(NAME));
+  dialog->queryAtom("atom-by-id", &first, MapOfActions::getInstance().getDescription("atom-by-id"));
+
+  if(dialog->display()) {
+    delete dialog;
+    DoLog(1) && (Log() << Verbose(1) << "Removing atoms around " << first->nr << " with radius " << radius << "." << endl);
+    vector<atom*> AllAtoms = World::getInstance().getAllAtoms();
+    vector<atom*>::iterator AtomAdvancer = AllAtoms.begin();
+    for (vector<atom*>::iterator AtomRunner = AtomAdvancer; AtomRunner != AllAtoms.end(); ) {
+      ++AtomAdvancer;
+      if (first != *AtomRunner) // dont't destroy reference ...
+        if (first->x.DistanceSquared((*AtomRunner)->x) > radius*radius) // distance to first above radius ...
+          World::getInstance().destroyAtom(*AtomRunner);
+    }
+    World::getInstance().destroyAtom(first);
+    return Action::success;
+  } else {
+    delete dialog;
+    return Action::failure;
+  }
+
+}
+
+Action::state_ptr WorldRemoveSphereOfAtomsAction::performUndo(Action::state_ptr _state) {
+//  ParserLoadXyzState *state = assert_cast<ParserLoadXyzState*>(_state.get());
+
+  return Action::failure;
+//  string newName = state->mol->getName();
+//  state->mol->setName(state->lastName);
+//
+//  return Action::state_ptr(new ParserLoadXyzState(state->mol,newName));
+}
+
+Action::state_ptr WorldRemoveSphereOfAtomsAction::performRedo(Action::state_ptr _state){
+  return Action::failure;
+}
+
+bool WorldRemoveSphereOfAtomsAction::canUndo() {
+  return false;
+}
+
+bool WorldRemoveSphereOfAtomsAction::shouldUndo() {
+  return false;
+}
+
+const string WorldRemoveSphereOfAtomsAction::getName() {
+  return NAME;
+}
Index: src/Actions/WorldAction/RemoveSphereOfAtomsAction.hpp
===================================================================
--- src/Actions/WorldAction/RemoveSphereOfAtomsAction.hpp	(revision f941b14c7a92d23575eccdfcd7bbb7ef127d1bad)
+++ src/Actions/WorldAction/RemoveSphereOfAtomsAction.hpp	(revision f941b14c7a92d23575eccdfcd7bbb7ef127d1bad)
@@ -0,0 +1,30 @@
+/*
+ * RemoveSphereOfAtomsAction.hpp
+ *
+ *  Created on: May 9, 2010
+ *      Author: heber
+ */
+
+#ifndef REMOVESPHEREOFATOMS_HPP_
+#define REMOVESPHEREOFATOMS_HPP_
+
+#include "Actions/Action.hpp"
+
+class WorldRemoveSphereOfAtomsAction : public Action {
+public:
+  WorldRemoveSphereOfAtomsAction();
+  virtual ~WorldRemoveSphereOfAtomsAction();
+
+  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 /* REMOVESPHEREOFATOMS_HPP_ */
Index: src/Actions/WorldAction/RepeatBoxAction.cpp
===================================================================
--- src/Actions/WorldAction/RepeatBoxAction.cpp	(revision f941b14c7a92d23575eccdfcd7bbb7ef127d1bad)
+++ src/Actions/WorldAction/RepeatBoxAction.cpp	(revision f941b14c7a92d23575eccdfcd7bbb7ef127d1bad)
@@ -0,0 +1,126 @@
+/*
+ * RepeatBoxAction.cpp
+ *
+ *  Created on: May 12, 2010
+ *      Author: heber
+ */
+
+#include "Actions/WorldAction/RepeatBoxAction.hpp"
+#include "CommandLineParser.hpp"
+#include "atom.hpp"
+#include "log.hpp"
+#include "molecule.hpp"
+#include "vector.hpp"
+#include "verbose.hpp"
+#include "World.hpp"
+
+#include <iostream>
+#include <string>
+
+using namespace std;
+
+#include "UIElements/UIFactory.hpp"
+#include "UIElements/Dialog.hpp"
+#include "Actions/MapOfActions.hpp"
+
+const char WorldRepeatBoxAction::NAME[] = "repeat-box";
+
+WorldRepeatBoxAction::WorldRepeatBoxAction() :
+  Action(NAME)
+{}
+
+WorldRepeatBoxAction::~WorldRepeatBoxAction()
+{}
+
+Action::state_ptr WorldRepeatBoxAction::performCall() {
+  Dialog *dialog = UIFactory::getInstance().makeDialog();
+  Vector Repeater;
+  int count;
+  const element ** Elements;
+  molecule *mol = NULL;
+  int j = 0;
+
+  dialog->queryVector(NAME, &Repeater, World::getInstance().getDomain(), false, MapOfActions::getInstance().getDescription(NAME));
+  dialog->queryMolecule("molecule-by-id", &mol,MapOfActions::getInstance().getDescription("molecule-by-id"));
+
+  if(dialog->display()) {
+    double * const cell_size = World::getInstance().getDomain();
+    Vector x,y;
+    for (int axis = 1; axis <= NDIM; axis++) {
+      Vector ** vectors;
+      Repeater[axis] = floor(Repeater[axis]);
+      if (Repeater[axis] < 1) {
+        DoeLog(1) && (eLog()<< Verbose(1) << "Repetition factor must be greater than 1!" << endl);
+        Repeater[axis] = 1;
+      }
+      mol->CountAtoms();  // recount atoms
+      if (mol->AtomCount != 0) {  // if there is more than none
+        count = mol->AtomCount;   // is changed becausing of adding, thus has to be stored away beforehand
+        Elements = new const element *[count];
+        vectors = new Vector *[count];
+        j = 0;
+        atom *first = mol->start;
+        while (first->next != mol->end) {  // make a list of all atoms with coordinates and element
+          first = first->next;
+          Elements[j] = first->type;
+          vectors[j] = &first->x;
+          j++;
+        }
+        if (count != j)
+          DoeLog(1) && (eLog()<< Verbose(1) << "AtomCount " << count << " is not equal to number of atoms in molecule " << j << "!" << endl);
+        x.Zero();
+        y.Zero();
+        y[abs(axis)-1] = cell_size[(abs(axis) == 2) ? 2 : ((abs(axis) == 3) ? 5 : 0)] * abs(axis)/axis; // last term is for sign, first is for magnitude
+        for (int i=1;i<Repeater[axis];i++) {  // then add this list with respective translation factor times
+          x += y; // per factor one cell width further
+          for (int k=count;k--;) { // go through every atom of the original cell
+            first = World::getInstance().createAtom(); // create a new body
+            first->x = (*vectors[k]) + x;
+            first->type = Elements[k];  // insert original element
+            mol->AddAtom(first);        // and add to the molecule (which increments ElementsInMolecule, AtomCount, ...)
+          }
+        }
+        // free memory
+        delete[](Elements);
+        delete[](vectors);
+        // correct cell size
+        if (axis < 0) { // if sign was negative, we have to translate everything
+          x =(-(Repeater[axis]-1)) * y;
+          mol->Translate(&x);
+        }
+        cell_size[(abs(axis) == 2) ? 2 : ((abs(axis) == 3) ? 5 : 0)] *= Repeater[axis];
+      }
+    }
+    delete dialog;
+    return Action::success;
+  } else {
+    delete dialog;
+    return Action::failure;
+  }
+}
+
+Action::state_ptr WorldRepeatBoxAction::performUndo(Action::state_ptr _state) {
+//  ParserLoadXyzState *state = assert_cast<ParserLoadXyzState*>(_state.get());
+
+  return Action::failure;
+//  string newName = state->mol->getName();
+//  state->mol->setName(state->lastName);
+//
+//  return Action::state_ptr(new ParserLoadXyzState(state->mol,newName));
+}
+
+Action::state_ptr WorldRepeatBoxAction::performRedo(Action::state_ptr _state){
+  return Action::failure;
+}
+
+bool WorldRepeatBoxAction::canUndo() {
+  return false;
+}
+
+bool WorldRepeatBoxAction::shouldUndo() {
+  return false;
+}
+
+const string WorldRepeatBoxAction::getName() {
+  return NAME;
+}
Index: src/Actions/WorldAction/RepeatBoxAction.hpp
===================================================================
--- src/Actions/WorldAction/RepeatBoxAction.hpp	(revision f941b14c7a92d23575eccdfcd7bbb7ef127d1bad)
+++ src/Actions/WorldAction/RepeatBoxAction.hpp	(revision f941b14c7a92d23575eccdfcd7bbb7ef127d1bad)
@@ -0,0 +1,30 @@
+/*
+ * RepeatBoxAction.hpp
+ *
+ *  Created on: May 12, 2010
+ *      Author: heber
+ */
+
+#ifndef REPEATBOXACTION_HPP_
+#define REPEATBOXACTION_HPP_
+
+#include "Actions/Action.hpp"
+
+class WorldRepeatBoxAction : public Action {
+public:
+  WorldRepeatBoxAction();
+  virtual ~WorldRepeatBoxAction();
+
+  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 /* REPEATBOXACTION_HPP_ */
Index: src/Actions/WorldAction/ScaleBoxAction.cpp
===================================================================
--- src/Actions/WorldAction/ScaleBoxAction.cpp	(revision f941b14c7a92d23575eccdfcd7bbb7ef127d1bad)
+++ src/Actions/WorldAction/ScaleBoxAction.cpp	(revision f941b14c7a92d23575eccdfcd7bbb7ef127d1bad)
@@ -0,0 +1,89 @@
+/*
+ * ScaleBoxAction.cpp
+ *
+ *  Created on: May 8, 2010
+ *      Author: heber
+ */
+
+#include "Actions/WorldAction/ScaleBoxAction.hpp"
+#include "CommandLineParser.hpp"
+#include "atom.hpp"
+#include "log.hpp"
+#include "vector.hpp"
+#include "verbose.hpp"
+#include "World.hpp"
+
+#include <iostream>
+#include <string>
+
+using namespace std;
+
+#include "UIElements/UIFactory.hpp"
+#include "UIElements/Dialog.hpp"
+#include "Actions/MapOfActions.hpp"
+
+const char WorldScaleBoxAction::NAME[] = "scale-box";
+
+WorldScaleBoxAction::WorldScaleBoxAction() :
+  Action(NAME)
+{}
+
+WorldScaleBoxAction::~WorldScaleBoxAction()
+{}
+
+Action::state_ptr WorldScaleBoxAction::performCall() {
+  Dialog *dialog = UIFactory::getInstance().makeDialog();
+  Vector Scaler;
+  double x[NDIM];
+  int j=0;
+
+  dialog->queryVector(NAME, &Scaler, World::getInstance().getDomain(), false, MapOfActions::getInstance().getDescription(NAME));
+
+  if(dialog->display()) {
+    DoLog(1) && (Log() << Verbose(1) << "Scaling all atomic positions by factor." << endl);
+    for (int i=0;i<NDIM;i++)
+      x[i] = Scaler[i];
+    vector<atom*> AllAtoms = World::getInstance().getAllAtoms();
+    for(vector<atom*>::iterator AtomRunner = AllAtoms.begin(); AtomRunner != AllAtoms.end(); ++AtomRunner) {
+      (*AtomRunner)->x.ScaleAll(x);
+    }
+    j = -1;
+    double * const cell_size = World::getInstance().getDomain();
+    for (int i=0;i<NDIM;i++) {
+      j += i+1;
+      cell_size[j]*=x[i];
+    }
+
+    delete dialog;
+    return Action::success;
+  } else {
+    delete dialog;
+    return Action::failure;
+  }
+}
+
+Action::state_ptr WorldScaleBoxAction::performUndo(Action::state_ptr _state) {
+//  ParserLoadXyzState *state = assert_cast<ParserLoadXyzState*>(_state.get());
+
+  return Action::failure;
+//  string newName = state->mol->getName();
+//  state->mol->setName(state->lastName);
+//
+//  return Action::state_ptr(new ParserLoadXyzState(state->mol,newName));
+}
+
+Action::state_ptr WorldScaleBoxAction::performRedo(Action::state_ptr _state){
+  return Action::failure;
+}
+
+bool WorldScaleBoxAction::canUndo() {
+  return false;
+}
+
+bool WorldScaleBoxAction::shouldUndo() {
+  return false;
+}
+
+const string WorldScaleBoxAction::getName() {
+  return NAME;
+}
Index: src/Actions/WorldAction/ScaleBoxAction.hpp
===================================================================
--- src/Actions/WorldAction/ScaleBoxAction.hpp	(revision f941b14c7a92d23575eccdfcd7bbb7ef127d1bad)
+++ src/Actions/WorldAction/ScaleBoxAction.hpp	(revision f941b14c7a92d23575eccdfcd7bbb7ef127d1bad)
@@ -0,0 +1,30 @@
+/*
+ * ScaleBoxAction.hpp
+ *
+ *  Created on: May 8, 2010
+ *      Author: heber
+ */
+
+#ifndef SCALEBOXACTION_HPP_
+#define SCALEBOXACTION_HPP_
+
+#include "Actions/Action.hpp"
+
+class WorldScaleBoxAction : public Action {
+public:
+  WorldScaleBoxAction();
+  virtual ~WorldScaleBoxAction();
+
+  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 /* SCALEBOXACTION_HPP_ */
Index: src/Actions/WorldAction/SetDefaultNameAction.cpp
===================================================================
--- src/Actions/WorldAction/SetDefaultNameAction.cpp	(revision f941b14c7a92d23575eccdfcd7bbb7ef127d1bad)
+++ src/Actions/WorldAction/SetDefaultNameAction.cpp	(revision f941b14c7a92d23575eccdfcd7bbb7ef127d1bad)
@@ -0,0 +1,74 @@
+/*
+ * SetDefaultNameAction.cpp
+ *
+ *  Created on: May 8, 2010
+ *      Author: heber
+ */
+
+#include "Actions/WorldAction/SetDefaultNameAction.hpp"
+#include "CommandLineParser.hpp"
+#include "log.hpp"
+#include "World.hpp"
+
+#include <iostream>
+#include <string>
+
+using namespace std;
+
+#include "UIElements/UIFactory.hpp"
+#include "UIElements/Dialog.hpp"
+#include "Actions/MapOfActions.hpp"
+
+const char WorldSetDefaultNameAction::NAME[] = "default-molname";
+
+WorldSetDefaultNameAction::WorldSetDefaultNameAction() :
+  Action(NAME)
+{}
+
+WorldSetDefaultNameAction::~WorldSetDefaultNameAction()
+{}
+
+Action::state_ptr WorldSetDefaultNameAction::performCall() {
+  Dialog *dialog = UIFactory::getInstance().makeDialog();
+  string defaultname;
+
+  defaultname = World::getInstance().getDefaultName();
+  dialog->queryString(NAME, &defaultname, MapOfActions::getInstance().getDescription(NAME));
+
+  if(dialog->display()) {
+    char outputname[MAXSTRINGSIZE];
+    strcpy(outputname, defaultname.c_str());
+    World::getInstance().setDefaultName(outputname);
+    delete dialog;
+    return Action::success;
+  } else {
+    delete dialog;
+    return Action::failure;
+  }
+}
+
+Action::state_ptr WorldSetDefaultNameAction::performUndo(Action::state_ptr _state) {
+//  ParserLoadXyzState *state = assert_cast<ParserLoadXyzState*>(_state.get());
+
+  return Action::failure;
+//  string newName = state->mol->getName();
+//  state->mol->setName(state->lastName);
+//
+//  return Action::state_ptr(new ParserLoadXyzState(state->mol,newName));
+}
+
+Action::state_ptr WorldSetDefaultNameAction::performRedo(Action::state_ptr _state){
+  return Action::failure;
+}
+
+bool WorldSetDefaultNameAction::canUndo() {
+  return false;
+}
+
+bool WorldSetDefaultNameAction::shouldUndo() {
+  return false;
+}
+
+const string WorldSetDefaultNameAction::getName() {
+  return NAME;
+}
Index: src/Actions/WorldAction/SetDefaultNameAction.hpp
===================================================================
--- src/Actions/WorldAction/SetDefaultNameAction.hpp	(revision f941b14c7a92d23575eccdfcd7bbb7ef127d1bad)
+++ src/Actions/WorldAction/SetDefaultNameAction.hpp	(revision f941b14c7a92d23575eccdfcd7bbb7ef127d1bad)
@@ -0,0 +1,30 @@
+/*
+ * SetDefaultNameAction.hpp
+ *
+ *  Created on: May 8, 2010
+ *      Author: heber
+ */
+
+#ifndef SETDEFAULTNAMEACTION_HPP_
+#define SETDEFAULTNAMEACTION_HPP_
+
+#include "Actions/Action.hpp"
+
+class WorldSetDefaultNameAction : public Action {
+public:
+  WorldSetDefaultNameAction();
+  virtual ~WorldSetDefaultNameAction();
+
+  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 /* SETDEFAULTNAMEACTION_HPP_ */
Index: src/Actions/WorldAction/SetGaussianBasisAction.cpp
===================================================================
--- src/Actions/WorldAction/SetGaussianBasisAction.cpp	(revision f941b14c7a92d23575eccdfcd7bbb7ef127d1bad)
+++ src/Actions/WorldAction/SetGaussianBasisAction.cpp	(revision f941b14c7a92d23575eccdfcd7bbb7ef127d1bad)
@@ -0,0 +1,69 @@
+/*
+ * SetGaussianBasisAction.cpp
+ *
+ *  Created on: May 8, 2010
+ *      Author: heber
+ */
+
+#include "Actions/WorldAction/SetGaussianBasisAction.hpp"
+#include "CommandLineParser.hpp"
+#include "config.hpp"
+#include "World.hpp"
+
+#include <iostream>
+#include <string>
+
+using namespace std;
+
+#include "UIElements/UIFactory.hpp"
+#include "UIElements/Dialog.hpp"
+#include "Actions/MapOfActions.hpp"
+
+const char WorldSetGaussianBasisAction::NAME[] = "set-basis";
+
+WorldSetGaussianBasisAction::WorldSetGaussianBasisAction() :
+  Action(NAME)
+{}
+
+WorldSetGaussianBasisAction::~WorldSetGaussianBasisAction()
+{}
+
+Action::state_ptr WorldSetGaussianBasisAction::performCall() {
+  Dialog *dialog = UIFactory::getInstance().makeDialog();
+
+  dialog->queryString(NAME, &World::getInstance().getConfig()->basis, MapOfActions::getInstance().getDescription(NAME));
+
+  if(dialog->display()) {
+    delete dialog;
+    return Action::success;
+  } else {
+    delete dialog;
+    return Action::failure;
+  }
+}
+
+Action::state_ptr WorldSetGaussianBasisAction::performUndo(Action::state_ptr _state) {
+//  ParserLoadXyzState *state = assert_cast<ParserLoadXyzState*>(_state.get());
+
+  return Action::failure;
+//  string newName = state->mol->getName();
+//  state->mol->setName(state->lastName);
+//
+//  return Action::state_ptr(new ParserLoadXyzState(state->mol,newName));
+}
+
+Action::state_ptr WorldSetGaussianBasisAction::performRedo(Action::state_ptr _state){
+  return Action::failure;
+}
+
+bool WorldSetGaussianBasisAction::canUndo() {
+  return false;
+}
+
+bool WorldSetGaussianBasisAction::shouldUndo() {
+  return false;
+}
+
+const string WorldSetGaussianBasisAction::getName() {
+  return NAME;
+}
Index: src/Actions/WorldAction/SetGaussianBasisAction.hpp
===================================================================
--- src/Actions/WorldAction/SetGaussianBasisAction.hpp	(revision f941b14c7a92d23575eccdfcd7bbb7ef127d1bad)
+++ src/Actions/WorldAction/SetGaussianBasisAction.hpp	(revision f941b14c7a92d23575eccdfcd7bbb7ef127d1bad)
@@ -0,0 +1,30 @@
+/*
+ * SetGaussianBasisAction.hpp
+ *
+ *  Created on: May 8, 2010
+ *      Author: heber
+ */
+
+#ifndef SETGAUSSIANBASISACTION_HPP_
+#define SETGAUSSIANBASISACTION_HPP_
+
+#include "Actions/Action.hpp"
+
+class WorldSetGaussianBasisAction : public Action {
+public:
+  WorldSetGaussianBasisAction();
+  virtual ~WorldSetGaussianBasisAction();
+
+  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 /* SETGAUSSIANBASISACTION_HPP_ */
Index: c/Actions/small_actions.cpp
===================================================================
--- src/Actions/small_actions.cpp	(revision 12872df33639e521d4b0225d6064ea91bd4f18e8)
+++ 	(revision )
@@ -1,80 +1,0 @@
-#include "Actions/small_actions.hpp"
-
-#include <iostream>
-#include <string>
-
-using namespace std;
-
-#include "UIElements/UIFactory.hpp"
-#include "UIElements/Dialog.hpp"
-
-#include "atom.hpp"
-#include "molecule.hpp"
-
-/****** ChangeMoleculeNameAction *****/
-
-// memento to remember the state when undoing
-
-class ChangeMoleculeNameState : public ActionState {
-public:
-  ChangeMoleculeNameState(molecule* _mol,std::string _lastName) :
-    mol(_mol),
-    lastName(_lastName)
-  {}
-  molecule* mol;
-  std::string lastName;
-};
-
-const char ChangeMoleculeNameAction::NAME[] = "Change filename of Molecule";
-
-ChangeMoleculeNameAction::ChangeMoleculeNameAction(MoleculeListClass *_molecules) :
-  Action(NAME),
-  molecules(_molecules)
-{}
-
-ChangeMoleculeNameAction::~ChangeMoleculeNameAction()
-{}
-
-Action::state_ptr ChangeMoleculeNameAction::performCall() {
-  string filename;
-  molecule *mol = NULL;
-  Dialog *dialog = UIFactory::getInstance().makeDialog();
-
-  dialog->queryMolecule("Enter index of molecule: ",&mol,molecules);
-  dialog->queryString("Enter name: ",&filename);
-
-  if(dialog->display()) {
-    string oldName = mol->getName();
-    mol->setName(filename);
-    delete dialog;
-    return Action::state_ptr(new ChangeMoleculeNameState(mol,oldName));
-  }
-  delete dialog;
-  return Action::failure;
-}
-
-Action::state_ptr ChangeMoleculeNameAction::performUndo(Action::state_ptr _state) {
-  ChangeMoleculeNameState *state = assert_cast<ChangeMoleculeNameState*>(_state.get());
-
-  string newName = state->mol->getName();
-  state->mol->setName(state->lastName);
-
-  return Action::state_ptr(new ChangeMoleculeNameState(state->mol,newName));
-}
-
-Action::state_ptr ChangeMoleculeNameAction::performRedo(Action::state_ptr _state){
-  // Undo and redo have to do the same for this action
-  return performUndo(_state);
-}
-
-bool ChangeMoleculeNameAction::canUndo() {
-  return true;
-}
-
-bool ChangeMoleculeNameAction::shouldUndo() {
-  return true;
-}
-
-const string ChangeMoleculeNameAction::getName() {
-  return NAME;
-}
Index: c/Actions/small_actions.hpp
===================================================================
--- src/Actions/small_actions.hpp	(revision 12872df33639e521d4b0225d6064ea91bd4f18e8)
+++ 	(revision )
@@ -1,30 +1,0 @@
-// All rather small Actions should go into this file for simplicities sake
-
-#ifndef _SMALL_ACTIONS_HPP
-#define _SMALL_ACTIONS_HPP
-
-#include "Actions/Action.hpp"
-#include "Actions/Process.hpp"
-
-class MoleculeListClass;
-
-class ChangeMoleculeNameAction : public Action {
-public:
-  ChangeMoleculeNameAction(MoleculeListClass*);
-  virtual ~ChangeMoleculeNameAction();
-
-  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);
-
-  MoleculeListClass *molecules;
-  static const char NAME[];
-};
-
-
-#endif // _SMALL_ACTIONS_HPP
Index: src/CommandLineParser.cpp
===================================================================
--- src/CommandLineParser.cpp	(revision f941b14c7a92d23575eccdfcd7bbb7ef127d1bad)
+++ src/CommandLineParser.cpp	(revision f941b14c7a92d23575eccdfcd7bbb7ef127d1bad)
@@ -0,0 +1,80 @@
+/*
+ * CommandLineParser.cpp
+ *
+ *  Created on: May 8, 2010
+ *      Author: heber
+ */
+
+#include <boost/program_options.hpp>
+#include <fstream>
+#include <iostream>
+
+#include "Patterns/Singleton_impl.hpp"
+#include "CommandLineParser.hpp"
+
+using namespace std;
+
+/** Constructor of class CommandLineParser.
+ *
+ */
+CommandLineParser::CommandLineParser() :
+  generic("Generic options"),
+  config("Configuration"),
+  hidden("Hidden options"),
+  visible("Allowed options")
+{}
+
+/** Destructor of class CommandLineParser.
+ *
+ */
+CommandLineParser::~CommandLineParser()
+{}
+
+/** Parses the command line arguments.
+ * Calls program_options::store() and program_options::notify()
+ */
+void CommandLineParser::Parse()
+{
+  po::store(po::command_line_parser(argc,argv).options(cmdline_options).options(visible).positional(inputfile).run(), vm);
+  ifstream input;
+  input.open("example.cfg");
+  if (!input.fail())
+    po::store(po::parse_config_file(input, config_file_options), vm);
+  input.close();
+  po::notify(vm);
+}
+
+
+
+/** States whether there are command line arguments.
+ * \return true - there are none, false - there is at least one command line argument
+ */
+bool CommandLineParser::isEmpty()
+{
+  return vm.empty();
+}
+
+/** Sets the options.
+ * \param _argc arg count from main()
+ * \param **_argv argument array from main()
+ */
+void CommandLineParser::setOptions(int _argc, char **_argv)
+{
+  argc = _argc;
+  argv = _argv;
+  cmdline_options.add(generic).add(config).add(hidden);
+  config_file_options.add(config).add(hidden);
+  visible.add(generic).add(config);
+}
+
+/** Makes the Parser parse the command line options with current known options.
+ * \param _argc arg count from main()
+ * \param **_argv argument array from main()
+ */
+void CommandLineParser::Run(int _argc, char **_argv)
+{
+  setOptions(_argc,_argv);
+  Parse();
+}
+
+CONSTRUCT_SINGLETON(CommandLineParser)
Index: src/CommandLineParser.hpp
===================================================================
--- src/CommandLineParser.hpp	(revision f941b14c7a92d23575eccdfcd7bbb7ef127d1bad)
+++ src/CommandLineParser.hpp	(revision f941b14c7a92d23575eccdfcd7bbb7ef127d1bad)
@@ -0,0 +1,64 @@
+/*
+ * CommandLineParser.hpp
+ *
+ *  Created on: May 8, 2010
+ *      Author: heber
+ */
+
+#ifndef COMMANDLINEPARSER_HPP_
+#define COMMANDLINEPARSER_HPP_
+
+#include <boost/program_options.hpp>
+
+namespace po = boost::program_options;
+
+#include "Patterns/Singleton.hpp"
+
+
+class CommandLineParser : public Singleton<CommandLineParser> {
+  friend class Singleton<CommandLineParser>;
+public:
+
+  // Parses the command line arguments in CommandLineParser::**argv with currently known options.
+  void Run(int _argc, char **_argv);
+
+  // Checks whether there have been any commands on the command line.
+  bool isEmpty();
+
+  /* boost's program_options are sorted into three categories:
+   * -# generic options: option available to both command line and config
+   * -# config options: only available in the config file
+   * -# hidden options: options which the user is not shown on "help"
+   */
+  po::options_description generic;
+  po::options_description config;
+  po::options_description hidden;
+  po::positional_options_description inputfile;
+
+  po::options_description visible;
+
+  po::variables_map vm;
+
+private:
+  // private constructor and destructor
+  CommandLineParser();
+  virtual ~CommandLineParser();
+
+  /* The following program_options options_decriptions are used to
+   * generate the various cases and call differently in Parse().
+   */
+  po::options_description cmdline_options;
+  po::options_description config_file_options;
+
+  // Sets the options from the three cases.
+  void setOptions(int _argc, char **_argv);
+
+  // Parses all options from command line and config file
+  void Parse();
+
+  // argument counter and array passed on from main()
+  int argc;
+  char **argv;
+};
+
+#endif /* COMMANDLINEPARSER_HPP_ */
Index: src/Legacy/oldmenu.cpp
===================================================================
--- src/Legacy/oldmenu.cpp	(revision 12872df33639e521d4b0225d6064ea91bd4f18e8)
+++ src/Legacy/oldmenu.cpp	(revision f941b14c7a92d23575eccdfcd7bbb7ef127d1bad)
@@ -35,4 +35,5 @@
 #include "Menu/DisplayMenuItem.hpp"
 #include "Menu/SubMenuItem.hpp"
+#include "Actions/MapOfActions.hpp"
 #include "Actions/MethodAction.hpp"
 #include "Actions/ErrorAction.hpp"
@@ -908,6 +909,6 @@
   molecule *srcmol = NULL, *destmol = NULL;
   Dialog *dialog = UIFactory::getInstance().makeDialog();
-  dialog->queryMolecule("Enter index of destination molecule: ",&destmol, molecules);
-  dialog->queryMolecule("Enter index of source molecule to add from: ",&srcmol, molecules);
+  dialog->queryMolecule("molecule-by-id",&destmol, MapOfActions::getInstance().getDescription("molecule-by-id"));
+  dialog->queryMolecule("molecule-by-id",&srcmol, MapOfActions::getInstance().getDescription("molecule-by-id"));
   if(dialog->display()) {
     molecules->SimpleAdd(srcmol, destmol);
@@ -922,6 +923,6 @@
   molecule *srcmol = NULL, *destmol = NULL;
   Dialog *dialog = UIFactory::getInstance().makeDialog();
-  dialog->queryMolecule("Enter index of matrix molecule (the variable one): ",&srcmol,molecules);
-  dialog->queryMolecule("Enter index of molecule to merge into (the fixed one): ",&destmol,molecules);
+  dialog->queryMolecule("molecule-by-id",&destmol, MapOfActions::getInstance().getDescription("molecule-by-id"));
+  dialog->queryMolecule("molecule-by-id",&srcmol, MapOfActions::getInstance().getDescription("molecule-by-id"));
   if(dialog->display()) {
     molecules->EmbedMerge(destmol, srcmol);
Index: src/Makefile.am
===================================================================
--- src/Makefile.am	(revision 12872df33639e521d4b0225d6064ea91bd4f18e8)
+++ src/Makefile.am	(revision f941b14c7a92d23575eccdfcd7bbb7ef127d1bad)
@@ -1,66 +1,292 @@
+# PLEASE adhere to the alphabetical ordering in this Makefile!
+# Also indentation by a single tab
+
 # this includes source files that need to be present at multiple points
-HELPERSOURCE =  Helpers/Assert.cpp \
-		 		Helpers/MemDebug.cpp
+HELPERSOURCE =  \
+  Helpers/Assert.cpp \
+  Helpers/MemDebug.cpp
 		        
-ATOMSOURCE = atom.cpp atom_atominfo.cpp atom_bondedparticle.cpp atom_bondedparticleinfo.cpp atom_graphnode.cpp atom_graphnodeinfo.cpp atom_particleinfo.cpp atom_trajectoryparticle.cpp atom_trajectoryparticleinfo.cpp
-ATOMHEADER = atom.hpp atom_atominfo.hpp atom_bondedparticle.hpp atom_bondedparticleinfo.hpp atom_graphnode.hpp atom_graphnodeinfo.hpp atom_particleinfo.hpp atom_trajectoryparticle.hpp atom_trajectoryparticleinfo.hpp
-
-LINALGSOURCE = ${HELPERSOURCE} \
-               gslmatrix.cpp \
-			   gslvector.cpp \
-			   linearsystemofequations.cpp \
-			   Space.cpp \
-			   vector.cpp
+ATOMSOURCE = \
+  atom.cpp \
+  atom_atominfo.cpp \
+  atom_bondedparticle.cpp \
+  atom_bondedparticleinfo.cpp \
+  atom_graphnode.cpp \
+  atom_graphnodeinfo.cpp \
+  atom_particleinfo.cpp \
+  atom_trajectoryparticle.cpp \
+  atom_trajectoryparticleinfo.cpp
+ATOMHEADER = \
+  atom.hpp \
+  atom_atominfo.hpp \
+  atom_bondedparticle.hpp \
+  atom_bondedparticleinfo.hpp \
+  atom_graphnode.hpp \
+  atom_graphnodeinfo.hpp \
+  atom_particleinfo.hpp \
+  atom_trajectoryparticle.hpp \
+  atom_trajectoryparticleinfo.hpp
+
+LINALGSOURCE = \
+  ${HELPERSOURCE} \
+  gslmatrix.cpp \
+  gslvector.cpp \
+  linearsystemofequations.cpp \
+  Space.cpp \
+  vector.cpp
 			   
 LINALGHEADER = gslmatrix.hpp \
-			   gslvector.hpp \
-			   linearsystemofequations.hpp \
-			   Space.hpp \
-			   vector.hpp
+  gslvector.hpp \
+  linearsystemofequations.hpp \
+  Space.hpp \
+  vector.hpp
 			   
-
-ANALYSISSOURCE = analysis_bonds.cpp analysis_correlation.cpp
-ANALYSISHEADER = analysis_bonds.hpp analysis_correlation.hpp
+ANALYSISSOURCE = \
+  analysis_bonds.cpp \
+  analysis_correlation.cpp
+ANALYSISHEADER = \
+  analysis_bonds.hpp \
+  analysis_correlation.hpp
 
 ACTIONSSOURCE = Actions/Action.cpp \
-				Actions/ActionHistory.cpp \
-				Actions/ActionRegistry.cpp \
-				Actions/ActionSequence.cpp \
-				Actions/ErrorAction.cpp \
-				Actions/MakroAction.cpp \
-				Actions/ManipulateAtomsProcess.cpp \
-				Actions/MethodAction.cpp \
-                Actions/Process.cpp \
-                Actions/small_actions.cpp
-                
+  ${ANALYSISACTIONSOURCE} \
+  ${ATOMACTIONSOURCE} \
+  ${CMDACTIONSOURCE} \
+  ${FRAGMENTATIONACTIONSOURCE} \
+  ${MOLECULEACTIONSOURCE} \
+  ${PARSERACTIONSOURCE} \
+  ${TESSELATIONACTIONSOURCE} \
+  ${WORLDACTIONSOURCE} \
+  Actions/ActionHistory.cpp \
+  Actions/ActionRegistry.cpp \
+  Actions/ActionSequence.cpp \
+  Actions/ErrorAction.cpp \
+  Actions/MakroAction.cpp \
+  Actions/ManipulateAtomsProcess.cpp \
+  Actions/MapOfActions.cpp \
+  Actions/MethodAction.cpp \
+  Actions/Process.cpp
+
+ACTIONSHEADER = Actions/Action.hpp \
+  ${ANALYSISACTIONHEADER} \
+  ${ATOMACTIONHEADER} \
+  ${CMDACTIONHEADER} \
+  ${FRAGMENTATIONACTIONHEADER} \
+  ${MOLECULEACTIONHEADER} \
+  ${PARSERACTIONHEADER} \
+  ${TESSELATIONACTIONHEADER} \
+  ${WORLDACTIONHEADER} \
+  Actions/ActionHistory.hpp \
+  Actions/ActionRegistry.hpp \
+  Actions/ActionSequence.hpp \
+  Actions/Calculation.hpp \
+  Actions/Calculation_impl.hpp \
+  Actions/ErrorAction.hpp \
+  Actions/MakroAction.hpp \
+  Actions/ManipulateAtomsProcess.hpp \
+  Actions/MapOfActions.hpp \
+  Actions/MethodAction.hpp \
+  Actions/Process.hpp
+  
+ANALYSISACTIONSOURCE = \
+  Actions/AnalysisAction/MolecularVolumeAction.cpp \
+  Actions/AnalysisAction/PairCorrelationAction.cpp \
+  Actions/AnalysisAction/PairCorrelationToPointAction.cpp \
+  Actions/AnalysisAction/PairCorrelationToSurfaceAction.cpp \
+  Actions/AnalysisAction/PrincipalAxisSystemAction.cpp
+ANALYSISACTIONHEADER = \
+  Actions/AnalysisAction/MolecularVolumeAction.hpp \
+  Actions/AnalysisAction/PairCorrelationAction.hpp \
+  Actions/AnalysisAction/PairCorrelationToPointAction.hpp \
+  Actions/AnalysisAction/PairCorrelationToSurfaceAction.hpp \
+  Actions/AnalysisAction/PrincipalAxisSystemAction.hpp
+
+ATOMACTIONSOURCE = \
+  Actions/AtomAction/AddAction.cpp \
+  Actions/AtomAction/ChangeElementAction.cpp \
+  Actions/AtomAction/RemoveAction.cpp
+ATOMACTIONHEADER = \
+  Actions/AtomAction/AddAction.hpp \
+  Actions/AtomAction/ChangeElementAction.hpp \
+  Actions/AtomAction/RemoveAction.cpp
+
+CMDACTIONSOURCE = \
+  Actions/CmdAction/BondLengthTableAction.cpp \
+  Actions/CmdAction/ElementDbAction.cpp \
+  Actions/CmdAction/FastParsingAction.cpp \
+  Actions/CmdAction/HelpAction.cpp \
+  Actions/CmdAction/VerboseAction.cpp \
+  Actions/CmdAction/VersionAction.cpp
+CMDACTIONHEADER = \
+  Actions/CmdAction/BondLengthTableAction.hpp \
+  Actions/CmdAction/ElementDbAction.hpp \
+  Actions/CmdAction/FastParsingAction.hpp \
+  Actions/CmdAction/HelpAction.hpp \
+  Actions/CmdAction/VerboseAction.hpp \
+  Actions/CmdAction/VersionAction.hpp
+
+FRAGMENTATIONACTIONSOURCE = \
+  Actions/FragmentationAction/DepthFirstSearchAction.cpp \
+  Actions/FragmentationAction/FragmentationAction.cpp \
+  Actions/FragmentationAction/SubgraphDissectionAction.cpp               
+FRAGMENTATIONACTIONHEADER = \
+  Actions/FragmentationAction/DepthFirstSearchAction.hpp \
+  Actions/FragmentationAction/FragmentationAction.hpp \
+  Actions/FragmentationAction/SubgraphDissectionAction.hpp
+
+MOLECULEACTIONSOURCE = \
+  Actions/MoleculeAction/BondFileAction.cpp \
+  Actions/MoleculeAction/ChangeNameAction.cpp \
+  Actions/MoleculeAction/FillWithMoleculeAction.cpp \
+  Actions/MoleculeAction/LinearInterpolationofTrajectoriesAction.cpp \
+  Actions/MoleculeAction/RotateToPrincipalAxisSystemAction.cpp \
+  Actions/MoleculeAction/SaveAdjacencyAction.cpp \
+  Actions/MoleculeAction/SaveBondsAction.cpp \
+  Actions/MoleculeAction/SaveTemperatureAction.cpp \
+  Actions/MoleculeAction/SuspendInWaterAction.cpp \
+  Actions/MoleculeAction/TranslateAction.cpp \
+  Actions/MoleculeAction/VerletIntegrationAction.cpp
+MOLECULEACTIONHEADER = \
+  Actions/MoleculeAction/BondFileAction.hpp \
+  Actions/MoleculeAction/ChangeNameAction.hpp \
+  Actions/MoleculeAction/FillWithMoleculeAction.hpp \
+  Actions/MoleculeAction/LinearInterpolationofTrajectoriesAction.hpp \
+  Actions/MoleculeAction/RotateToPrincipalAxisSystemAction.hpp \
+  Actions/MoleculeAction/SaveAdjacencyAction.hpp \
+  Actions/MoleculeAction/SaveBondsAction.hpp \
+  Actions/MoleculeAction/SaveTemperatureAction.hpp \
+  Actions/MoleculeAction/SuspendInWaterAction.hpp \
+  Actions/MoleculeAction/TranslateAction.hpp \
+  Actions/MoleculeAction/VerletIntegrationAction.hpp
                  
-ACTIONSHEADER = Actions/Action.hpp \
-				Actions/ActionHistory.hpp \
-				Actions/ActionRegistry.hpp \
-				Actions/ActionSequence.hpp \
- 			    Actions/Calculation.hpp \
- 			    Actions/Calculation_impl.hpp \
- 			    Actions/ErrorAction.hpp \
- 			    Actions/MakroAction.hpp \
- 			    Actions/ManipulateAtomsProcess.hpp \
- 			    Actions/MethodAction.hpp \
- 			    Actions/Process.hpp \
- 			    Actions/small_actions.hpp
- 			    
- 			    
-
-PATTERNSOURCE = Patterns/Observer.cpp
-PATTERNHEADER = Patterns/Cacheable.hpp \
-				Patterns/Observer.hpp \
-                Patterns/Singleton.hpp
-
-VIEWSOURCE = Views/View.cpp Views/StringView.cpp Views/MethodStringView.cpp Views/StreamStringView.cpp
-VIEWHEADER = Views/View.hpp Views/StringView.hpp Views/MethodStringView.hpp Views/StreamStringView.hpp
-
-MENUSOURCE = Menu/Menu.cpp Menu/TextMenu.cpp Menu/MenuItem.cpp Menu/SubMenuItem.cpp Menu/ActionMenuItem.cpp Menu/SeperatorItem.cpp Menu/DisplayMenuItem.cpp
-MENUHEADER = Menu/Menu.hpp Menu/TextMenu.hpp Menu/MenuItem.hpp Menu/SubMenuItem.hpp Menu/ActionMenuItem.hpp Menu/SeperatorItem.hpp Menu/DisplayMenuItem.hpp
-
-UISOURCE = ${ACTIONSSOURCE} ${VIEWSOURCE} ${MENUSOURCE} UIElements/UIFactory.cpp UIElements/TextUIFactory.cpp UIElements/MainWindow.cpp UIElements/TextWindow.cpp UIElements/TextStatusIndicator.cpp UIElements/Dialog.cpp UIElements/TextDialog.cpp
-UIHEADER = ${ACTIONSHEADER} ${VIEWHEADER} ${MENUHEADER} UIElements/UIFactory.hpp UIElements/TextUIFactory.hpp UIElements/MainWindow.hpp UIElements/TextWindow.hpp UIElements/TextStatusIndicator.hpp UIElements/Dialog.hpp UIElements/TextDialog.hpp
+PARSERACTIONSOURCE = \
+  Actions/ParserAction/LoadXyzAction.cpp \
+  Actions/ParserAction/SaveXyzAction.cpp       
+PARSERACTIONHEADER = \
+  Actions/ParserAction/LoadXyzAction.hpp \
+  Actions/ParserAction/SaveXyzAction.hpp
+
+TESSELATIONACTIONSOURCE = \
+  Actions/TesselationAction/ConvexEnvelopeAction.cpp \
+  Actions/TesselationAction/NonConvexEnvelopeAction.cpp               
+TESSELATIONACTIONHEADER = \
+  Actions/TesselationAction/ConvexEnvelopeAction.hpp \
+  Actions/TesselationAction/NonConvexEnvelopeAction.hpp
+
+WORLDACTIONSOURCE = \
+  Actions/WorldAction/AddEmptyBoundaryAction.cpp \
+  Actions/WorldAction/BoundInBoxAction.cpp \
+  Actions/WorldAction/CenterInBoxAction.cpp \
+  Actions/WorldAction/CenterOnEdgeAction.cpp \
+  Actions/WorldAction/ChangeBoxAction.cpp \
+  Actions/WorldAction/RemoveSphereOfAtomsAction.cpp \
+  Actions/WorldAction/RepeatBoxAction.cpp \
+  Actions/WorldAction/ScaleBoxAction.cpp \
+  Actions/WorldAction/SetDefaultNameAction.cpp \
+  Actions/WorldAction/SetGaussianBasisAction.cpp               
+WORLDACTIONHEADER = \
+  Actions/WorldAction/AddEmptyBoundaryAction.hpp \
+  Actions/WorldAction/BoundInBoxAction.hpp \
+  Actions/WorldAction/CenterInBoxAction.hpp \
+  Actions/WorldAction/CenterOnEdgeAction.hpp \
+  Actions/WorldAction/ChangeBoxAction.hpp \
+  Actions/WorldAction/RemoveSphereOfAtomsAction.hpp \
+  Actions/WorldAction/RepeatBoxAction.hpp \
+  Actions/WorldAction/ScaleBoxAction.hpp \
+  Actions/WorldAction/SetDefaultNameAction.hpp \
+  Actions/WorldAction/SetGaussianBasisAction.hpp
+
+
+
+PARSERSOURCE = \
+  Parser/ChangeTracker.cpp \
+  Parser/FormatParser.cpp \
+  Parser/TremoloParser.cpp \
+  Parser/XyzParser.cpp
+PARSERHEADER = \
+  Parser/ChangeTracker.hpp \
+  Parser/FormatParser.hpp \
+  Parser/TremoloParser.hpp \
+  Parser/XyzParser.hpp
+
+PATTERNSOURCE = \
+  Patterns/Observer.cpp
+PATTERNHEADER = \
+  Patterns/Cacheable.hpp \
+  Patterns/Observer.hpp \
+  Patterns/Singleton.hpp
+
+# Below is all for the User Interface
+
+VIEWSOURCE = \
+  Views/View.cpp \
+  Views/StringView.cpp \
+  Views/MethodStringView.cpp \
+  Views/StreamStringView.cpp
+VIEWHEADER = \
+  Views/View.hpp \
+  Views/StringView.hpp \
+  Views/MethodStringView.hpp \
+  Views/StreamStringView.hpp
+
+MENUSOURCE = \
+  Menu/Menu.cpp \
+  Menu/TextMenu.cpp \
+  Menu/MenuItem.cpp \
+  Menu/SubMenuItem.cpp \
+  Menu/ActionMenuItem.cpp \
+  Menu/SeperatorItem.cpp \
+  Menu/DisplayMenuItem.cpp
+  
+MENUHEADER = \
+  Menu/Menu.hpp \
+  Menu/TextMenu.hpp \
+  Menu/MenuItem.hpp \
+  Menu/SubMenuItem.hpp \
+  Menu/ActionMenuItem.hpp \
+  Menu/SeperatorItem.hpp \
+  Menu/DisplayMenuItem.hpp
+
+UISOURCE = \
+  ${ACTIONSSOURCE} \
+  ${COMMANDLINEUISOURCE} \
+  ${MENUSOURCE} \
+  ${TEXTUISOURCE} \
+  ${VIEWSOURCE} \
+  UIElements/Dialog.cpp \
+  UIElements/MainWindow.cpp \
+  UIElements/UIFactory.cpp
+  
+UIHEADER = \
+  ${ACTIONSHEADER} \
+  ${COMMANDLINEUIHEADER} \
+  ${MENUHEADER} \
+  ${TEXTUIHEADER} \
+  ${VIEWHEADER} \
+  UIElements/Dialog.hpp \
+  UIElements/MainWindow.hpp \
+  UIElements/UIFactory.hpp
+
+TEXTUISOURCE = \
+  UIElements/TextDialog.cpp \
+  UIElements/TextStatusIndicator.cpp \
+  UIElements/TextUIFactory.cpp \
+  UIElements/TextWindow.cpp
+TEXTUIHEADER = \
+  UIElements/TextDialog.hpp \
+  UIElements/TextStatusIndicator.hpp \
+  UIElements/TextUIFactory.hpp \
+  UIElements/TextWindow.hpp
+
+COMMANDLINEUISOURCE = \
+  UIElements/CommandLineDialog.cpp \
+  UIElements/CommandLineStatusIndicator.cpp \
+  UIElements/CommandLineUIFactory.cpp \
+  UIElements/CommandLineWindow.cpp
+COMMANDLINEUIHEADER = \
+  UIElements/CommandLineDialog.hpp \
+  UIElements/CommandLineStatusIndicator.hpp \
+  UIElements/CommandLineUIFactory.hpp \
+  UIElements/CommandLineWindow.hpp
 
 # all these files are only used for legacy reasons while the transition is in progress
@@ -71,109 +297,112 @@
 
 DESCRIPTORSOURCE = Descriptors/AtomDescriptor.cpp \
-				   Descriptors/AtomIdDescriptor.cpp \
-				   Descriptors/AtomTypeDescriptor.cpp \
-				   Descriptors/MoleculeDescriptor.cpp \
-				   Descriptors/MoleculeIdDescriptor.cpp 
+  Descriptors/AtomIdDescriptor.cpp \
+  Descriptors/AtomTypeDescriptor.cpp \
+  Descriptors/MoleculeDescriptor.cpp \
+  Descriptors/MoleculeIdDescriptor.cpp 
 				   
 				   
 DESCRIPTORHEADER = Descriptors/AtomDescriptor.hpp \
-				   Descriptors/AtomIdDescriptor.hpp \
-				   Descriptors/AtomTypeDescriptor.hpp \
-				   Descriptors/MoleculeDescriptor.hpp \
-				   Descriptors/MoleculeIdDescriptor.hpp
+  Descriptors/AtomIdDescriptor.hpp \
+  Descriptors/AtomTypeDescriptor.hpp \
+  Descriptors/MoleculeDescriptor.hpp \
+  Descriptors/MoleculeIdDescriptor.hpp
 				   
-
-
 EXCEPTIONSOURCE = Exceptions/CustomException.cpp \
-				  Exceptions/LinearDependenceException.cpp \
-				  Exceptions/MathException.cpp \
-				  Exceptions/ZeroVectorException.cpp
+  Exceptions/LinearDependenceException.cpp \
+  Exceptions/MathException.cpp \
+  Exceptions/ZeroVectorException.cpp
 				  
 EXCEPTIONHEADER = Exceptions/CustomException.hpp \
-				  Exceptions/LinearDependenceException.hpp \
-				  Exceptions/MathException.hpp \
-				  Exceptions/ZeroVectorException.hpp
-
-SOURCE = ${ANALYSISSOURCE} \
-		 ${ATOMSOURCE} \
-		 ${PATTERNSOURCE} \
-		 ${UISOURCE} \
-		 ${DESCRIPTORSOURCE} \
-		 ${HELPERSOURCE} \
-		 ${LEGACYSOURCE} \
-		 ${EXCEPTIONSOURCE} \
-		 bond.cpp \
-		 bondgraph.cpp \
-		 boundary.cpp \
-		 config.cpp \
-		 element.cpp \
-		 ellipsoid.cpp \
-		 errorlogger.cpp \
-		 graph.cpp \
-		 helpers.cpp \
-		 info.cpp \
-		 leastsquaremin.cpp \
-		 Line.cpp \
-		 linkedcell.cpp \
-		 lists.cpp \
-		 log.cpp \
-		 logger.cpp \
-		 memoryusageobserver.cpp \
-		 moleculelist.cpp \
-		 molecule.cpp \
-		 molecule_dynamics.cpp \
-		 molecule_fragmentation.cpp \
-		 molecule_geometry.cpp \
-		 molecule_graph.cpp \
-		 molecule_pointcloud.cpp \
-		 parser.cpp \
-		 periodentafel.cpp \
-		 Plane.cpp \
-		 tesselation.cpp \
-		 tesselationhelpers.cpp \
-		 triangleintersectionlist.cpp \
-		 verbose.cpp \
-		 vector_ops.cpp \
-		 World.cpp
+  Exceptions/LinearDependenceException.hpp \
+  Exceptions/MathException.hpp \
+  Exceptions/ZeroVectorException.hpp
+
+SOURCE = \
+  ${ANALYSISSOURCE} \
+  ${ATOMSOURCE} \
+  ${PATTERNSOURCE} \
+  ${PARSERSOURCE} \
+  ${UISOURCE} \
+  ${DESCRIPTORSOURCE} \
+  ${HELPERSOURCE} \
+  ${LEGACYSOURCE} \
+  ${EXCEPTIONSOURCE} \
+  bond.cpp \
+  bondgraph.cpp \
+  boundary.cpp \
+  CommandLineParser.cpp \
+  config.cpp \
+  element.cpp \
+  ellipsoid.cpp \
+  errorlogger.cpp \
+  graph.cpp \
+  helpers.cpp \
+  info.cpp \
+  leastsquaremin.cpp \
+  Line.cpp \
+  linkedcell.cpp \
+  lists.cpp \
+  log.cpp \
+  logger.cpp \
+  memoryusageobserver.cpp \
+  moleculelist.cpp \
+  molecule.cpp \
+  molecule_dynamics.cpp \
+  molecule_fragmentation.cpp \
+  molecule_geometry.cpp \
+  molecule_graph.cpp \
+  molecule_pointcloud.cpp \
+  parser.cpp \
+  periodentafel.cpp \
+  Plane.cpp \
+  tesselation.cpp \
+  tesselationhelpers.cpp \
+  triangleintersectionlist.cpp \
+  verbose.cpp \
+  vector_ops.cpp \
+  World.cpp
 
 HEADER = \
-	  ${ANALYSISHEADER} \
-	  ${ATOMHEADER} \
-	  ${PATTERNHEADER} \
-	  ${UIHEADER} \
-	  ${DESCRIPTORHEADER} \
-	  ${EXCEPTIONHEADER} \
-	  ${LEGACYHEADER} \
-	  bond.hpp \
-	  bondgraph.hpp \
-	  boundary.hpp \
-	  config.hpp \
-	  defs.hpp \
-	  element.hpp \
-	  ellipsoid.hpp \
-	  errorlogger.hpp \
-	  graph.hpp \
-	  helpers.hpp \
-	  info.hpp \
-	  leastsquaremin.hpp \
-	  Line.hpp \
-	  linkedcell.hpp \
-	  lists.hpp \
-	  log.hpp \
-	  logger.hpp \
-	  memoryallocator.hpp \
-	  memoryusageobserver.hpp \
-	  molecule.hpp \
-	  molecule_template.hpp \
-	  parser.hpp \
-	  periodentafel.hpp \
-	  Plane.hpp \
-	  stackclass.hpp \
-	  tesselation.hpp \
-	  tesselationhelpers.hpp \
-	  triangleintersectionlist.hpp \
-	  verbose.hpp \
-	  vector_ops.hpp \
-	  World.hpp 
+  ${ANALYSISHEADER} \
+  ${ATOMHEADER} \
+  ${PARSERHEADER} \
+  ${PATTERNHEADER} \
+  ${UIHEADER} \
+  ${DESCRIPTORHEADER} \
+  ${EXCEPTIONHEADER} \
+  ${LEGACYHEADER} \
+  bond.hpp \
+  bondgraph.hpp \
+  boundary.hpp \
+  CommandLineParser.hpp \
+  config.hpp \
+  defs.hpp \
+  element.hpp \
+  ellipsoid.hpp \
+  errorlogger.hpp \
+  graph.hpp \
+  helpers.hpp \
+  info.hpp \
+  leastsquaremin.hpp \
+  Line.hpp \
+  linkedcell.hpp \
+  lists.hpp \
+  log.hpp \
+  logger.hpp \
+  memoryallocator.hpp \
+  memoryusageobserver.hpp \
+  molecule.hpp \
+  molecule_template.hpp \
+  parser.hpp \
+  periodentafel.hpp \
+  Plane.hpp \
+  stackclass.hpp \
+  tesselation.hpp \
+  tesselationhelpers.hpp \
+  triangleintersectionlist.hpp \
+  verbose.hpp \
+  vector_ops.hpp \
+  World.hpp 
 
 BOOST_LIB = $(BOOST_LDFLAGS) $(BOOST_MPL_LIB)
@@ -188,11 +417,9 @@
 molecuilder_LDFLAGS = $(BOOST_LDFLAGS)
 molecuilder_SOURCES = builder.cpp
-molecuilder_LDADD = libmolecuilder.a libgslwrapper.a $(BOOST_LIB) ${BOOST_THREAD_LIB}
+molecuilder_LDADD = libmolecuilder.a libgslwrapper.a $(BOOST_LIB) ${BOOST_THREAD_LIB} ${BOOST_PROGRAM_OPTIONS_LIB}
 joiner_SOURCES = joiner.cpp datacreator.cpp parser.cpp datacreator.hpp helpers.hpp parser.hpp periodentafel.hpp
 joiner_LDADD = libmolecuilder.a $(BOOST_LIB) ${BOOST_THREAD_LIB}
 analyzer_SOURCES = analyzer.cpp datacreator.cpp parser.cpp helpers.hpp periodentafel.hpp parser.hpp datacreator.hpp 
 analyzer_LDADD = libmolecuilder.a $(BOOST_LIB) ${BOOST_THREAD_LIB}
-
-#EXTRA_DIST = ${molecuilder_DATA}
 
 FORCE:
Index: src/Parser/ChangeTracker.cpp
===================================================================
--- src/Parser/ChangeTracker.cpp	(revision f941b14c7a92d23575eccdfcd7bbb7ef127d1bad)
+++ src/Parser/ChangeTracker.cpp	(revision f941b14c7a92d23575eccdfcd7bbb7ef127d1bad)
@@ -0,0 +1,73 @@
+/*
+ * ChangeTracker.cpp
+ *
+ *  Created on: Mar 1, 2010
+ *      Author: metzler
+ */
+
+#include "ChangeTracker.hpp"
+
+ChangeTracker* ChangeTracker::instance = NULL;
+
+/**
+ * Constructor. Signs on as an observer for the World.
+ */
+ChangeTracker::ChangeTracker() {
+  isConsistent = true;
+  World::getInstance().signOn(this);
+}
+
+/**
+ * Destructor. Signs off from the World.
+ */
+ChangeTracker::~ChangeTracker() {
+  World::getInstance().signOff(this);
+}
+
+/**
+ * Returns the change tracker instance.
+ *
+ * \return this
+ */
+ChangeTracker* ChangeTracker::get() {
+  if (instance == NULL) {
+    instance = new ChangeTracker();
+  }
+
+  return instance;
+}
+
+/**
+ * Destroys the change tracker instance. Be careful, the change tracker is a
+ * singleton and destruction might lead to a loss of consistency.
+ */
+void ChangeTracker::destroy() {
+  delete instance;
+  instance = NULL;
+}
+
+/**
+ * With this, the World can update the change tracker's state.
+ */
+void ChangeTracker::update(Observable *publisher) {
+  isConsistent = false;
+}
+
+/**
+ * Gets whether there are non-saved changes.
+ *
+ * \param true if there are any changes, false otherwise
+ */
+bool ChangeTracker::hasChanged() {
+  return !isConsistent;
+}
+
+/**
+ * Tells all observers (which are the different parsers) that they are supposed
+ * to save the current state.
+ */
+void ChangeTracker::saveStatus() {
+  if (hasChanged()) {
+    notifyAll();
+  }
+}
Index: src/Parser/ChangeTracker.hpp
===================================================================
--- src/Parser/ChangeTracker.hpp	(revision f941b14c7a92d23575eccdfcd7bbb7ef127d1bad)
+++ src/Parser/ChangeTracker.hpp	(revision f941b14c7a92d23575eccdfcd7bbb7ef127d1bad)
@@ -0,0 +1,37 @@
+/*
+ * ChangeTracker.hpp
+ *
+ *  Created on: Mar 1, 2010
+ *      Author: metzler
+ */
+
+#ifndef CHANGETRACKER_HPP_
+#define CHANGETRACKER_HPP_
+
+#include "Patterns/Observer.hpp"
+#include "World.hpp"
+
+using namespace std;
+
+/**
+ * Observes the world and notifies subscribers via saveStatus if there are
+ * changes to it.
+ */
+class ChangeTracker : public Observable {
+public:
+  void saveStatus();
+  static ChangeTracker* get();
+  static void destroy();
+
+protected:
+  void update(Observable *publisher);
+  bool hasChanged();
+
+private:
+  bool isConsistent;
+  static ChangeTracker* instance;
+  ChangeTracker();
+  ~ChangeTracker();
+};
+
+#endif /* CHANGETRACKER_HPP_ */
Index: src/Parser/FormatParser.cpp
===================================================================
--- src/Parser/FormatParser.cpp	(revision f941b14c7a92d23575eccdfcd7bbb7ef127d1bad)
+++ src/Parser/FormatParser.cpp	(revision f941b14c7a92d23575eccdfcd7bbb7ef127d1bad)
@@ -0,0 +1,55 @@
+/*
+ * FormatParser.cpp
+ *
+ *  Created on: Mar 1, 2010
+ *      Author: metzler
+ */
+
+#include "FormatParser.hpp"
+#include <iostream>
+
+using namespace std;
+
+/**
+ * Constructor.
+ */
+FormatParser::FormatParser() {
+  ChangeTracker::get()->signOn(this);
+  saveStream = NULL;
+}
+
+/**
+ * Destructor.
+ */
+FormatParser::~FormatParser() {
+  ChangeTracker::get()->signOff(this);
+}
+
+/**
+ * Update operation which can be invoked by the observable (which should be the
+ * change tracker here).
+ */
+void FormatParser::update(Observable *publisher) {
+  if (!saveStream) {
+    cerr << "Please invoke setOstream() so the parser knows where to save the World's data." << endl;
+    return;
+  }
+
+  save(saveStream);
+}
+
+/**
+ * The observable can tell when it dies.
+ */
+void FormatParser::subjectKilled(Observable *publisher) {}
+
+
+/**
+ * Sets the output stream for save, so the save() method can be invoked on update
+ * automatically.
+ *
+ * \param ostream where to save the World's state
+ */
+void FormatParser::setOstream(ostream* output) {
+  saveStream = output;
+}
Index: src/Parser/FormatParser.hpp
===================================================================
--- src/Parser/FormatParser.hpp	(revision f941b14c7a92d23575eccdfcd7bbb7ef127d1bad)
+++ src/Parser/FormatParser.hpp	(revision f941b14c7a92d23575eccdfcd7bbb7ef127d1bad)
@@ -0,0 +1,32 @@
+/*
+ * FormatParser.hpp
+ *
+ *  Created on: Mar 1, 2010
+ *      Author: metzler
+ */
+
+#ifndef FORMATPARSER_HPP_
+#define FORMATPARSER_HPP_
+
+#include "Patterns/Observer.hpp"
+#include "ChangeTracker.hpp"
+#include "parser.hpp"
+
+/**
+ * General parser which observes the change tracker.
+ */
+class FormatParser : public Observer {
+public:
+  FormatParser();
+  virtual ~FormatParser();
+  virtual void save(std::ostream* file)=0;
+  virtual void load(std::istream* file)=0;
+  void setOstream(std::ostream* file);
+  void update(Observable *publisher);
+  void subjectKilled(Observable *publisher);
+
+private:
+  std::ostream* saveStream;
+};
+
+#endif /* FORMATPARSER_HPP_ */
Index: src/Parser/TremoloParser.cpp
===================================================================
--- src/Parser/TremoloParser.cpp	(revision f941b14c7a92d23575eccdfcd7bbb7ef127d1bad)
+++ src/Parser/TremoloParser.cpp	(revision f941b14c7a92d23575eccdfcd7bbb7ef127d1bad)
@@ -0,0 +1,495 @@
+/*
+ * TremoloParser.cpp
+ *
+ *  Created on: Mar 2, 2010
+ *      Author: metzler
+ */
+
+#include "Helpers/Assert.hpp"
+#include "TremoloParser.hpp"
+#include "World.hpp"
+#include "atom.hpp"
+#include "element.hpp"
+#include "bond.hpp"
+#include "periodentafel.hpp"
+#include "Descriptors/AtomIdDescriptor.hpp"
+#include <map>
+#include <vector>
+
+
+using namespace std;
+using namespace boost;
+
+/**
+ * Constructor.
+ */
+TremoloParser::TremoloParser() {
+  knownKeys[" "] = TremoloKey::noKey; // with this we can detect invalid keys
+  knownKeys["x"] = TremoloKey::x;
+  knownKeys["u"] = TremoloKey::u;
+  knownKeys["F"] = TremoloKey::F;
+  knownKeys["stress"] = TremoloKey::stress;
+  knownKeys["Id"] = TremoloKey::Id;
+  knownKeys["neighbors"] = TremoloKey::neighbors;
+  knownKeys["imprData"] = TremoloKey::imprData;
+  knownKeys["GroupMeasureTypeNo"] = TremoloKey::GroupMeasureTypeNo;
+  knownKeys["Type"] = TremoloKey::Type;
+  knownKeys["extType"] = TremoloKey::extType;
+  knownKeys["name"] = TremoloKey::name;
+  knownKeys["resName"] = TremoloKey::resName;
+  knownKeys["chainID"] = TremoloKey::chainID;
+  knownKeys["resSeq"] = TremoloKey::resSeq;
+  knownKeys["occupancy"] = TremoloKey::occupancy;
+  knownKeys["tempFactor"] = TremoloKey::tempFactor;
+  knownKeys["segID"] = TremoloKey::segID;
+  knownKeys["Charge"] = TremoloKey::Charge;
+  knownKeys["charge"] = TremoloKey::charge;
+  knownKeys["GrpTypeNo"] = TremoloKey::GrpTypeNo;
+  knownKeys["torsion"] = TremoloKey::torsion;
+}
+
+/**
+ * Destructor.
+ */
+TremoloParser::~TremoloParser() {
+  usedFields.clear();
+  additionalAtomData.clear();
+  atomIdMap.clear();
+  knownKeys.clear();
+}
+
+/**
+ * Loads atoms from a tremolo-formatted file.
+ *
+ * \param tremolo file
+ */
+void TremoloParser::load(istream* file) {
+  string line;
+  string::size_type location;
+
+  usedFields.clear();
+  while (file->good()) {
+    std::getline(*file, line, '\n');
+    if (usedFields.empty()) {
+      location = line.find("ATOMDATA", 0);
+      if (location != string::npos) {
+       parseAtomDataKeysLine(line, location + 8);
+      }
+    }
+    if (line.length() > 0 && line.at(0) != '#') {
+      readAtomDataLine(line);
+    }
+  }
+
+  processNeighborInformation();
+  adaptImprData();
+  adaptTorsion();
+}
+
+/**
+ * Saves the World's current state into as a tremolo file.
+ *
+ * \param file where to save the state
+ */
+void TremoloParser::save(ostream* file) {
+  vector<atom*>::iterator atomIt;
+  vector<string>::iterator it;
+
+  *file << "# ATOMDATA";
+  for (it=usedFields.begin(); it < usedFields.end(); it++) {
+    *file << "\t" << *it;
+  }
+  *file << endl;
+  vector<atom *> AtomList = World::getInstance().getAllAtoms();
+  for (atomIt = AtomList.begin(); atomIt != AtomList.end(); atomIt++) {
+    saveLine(file, *atomIt);
+  }
+}
+
+/**
+ * Sets the keys for which data should be written to the stream when save is
+ * called.
+ *
+ * \param string of field names with the same syntax as for an ATOMDATA line
+ *        but without the prexix "ATOMDATA"
+ */
+void TremoloParser::setFieldsForSave(std::string atomDataLine) {
+  parseAtomDataKeysLine(atomDataLine, 0);
+}
+
+
+/**
+ * Writes one line of tremolo-formatted data to the provided stream.
+ *
+ * \param stream where to write the line to
+ * \param reference to the atom of which information should be written
+ */
+void TremoloParser::saveLine(ostream* file, atom* currentAtom) {
+  vector<string>::iterator it;
+  TremoloKey::atomDataKey currentField;
+
+  for (it = usedFields.begin(); it != usedFields.end(); it++) {
+    currentField = knownKeys[it->substr(0, it->find("="))];
+    switch (currentField) {
+      case TremoloKey::x :
+        // for the moment, assume there are always three dimensions
+        *file << currentAtom->x[0] << "\t";
+        *file << currentAtom->x[1] << "\t";
+        *file << currentAtom->x[2] << "\t";
+        break;
+      case TremoloKey::u :
+        // for the moment, assume there are always three dimensions
+        *file << currentAtom->v[0] << "\t";
+        *file << currentAtom->v[1] << "\t";
+        *file << currentAtom->v[2] << "\t";
+        break;
+      case TremoloKey::Type :
+        *file << currentAtom->getType()->getSymbol() << "\t";
+        break;
+      case TremoloKey::Id :
+        *file << currentAtom->getId() << "\t";
+        break;
+      case TremoloKey::neighbors :
+        writeNeighbors(file, atoi(it->substr(it->find("=") + 1, 1).c_str()), currentAtom);
+        break;
+      default :
+        *file << (additionalAtomData.find(currentAtom->getId()) != additionalAtomData.end()
+          ? additionalAtomData[currentAtom->getId()].get(currentField)
+          : defaultAdditionalData.get(currentField));
+        *file << "\t";
+        break;
+    }
+  }
+
+  *file << endl;
+}
+
+/**
+ * Writes the neighbor information of one atom to the provided stream.
+ *
+ * \param stream where to write neighbor information to
+ * \param number of neighbors
+ * \param reference to the atom of which to take the neighbor information
+ */
+void TremoloParser::writeNeighbors(ostream* file, int numberOfNeighbors, atom* currentAtom) {
+  BondList::iterator currentBond = currentAtom->ListOfBonds.begin();
+  for (int i = 0; i < numberOfNeighbors; i++) {
+    *file << (currentBond != currentAtom->ListOfBonds.end()
+        ? (*currentBond)->GetOtherAtom(currentAtom)->getId() : 0) << "\t";
+  }
+}
+
+/**
+ * Stores keys from the ATOMDATA line.
+ *
+ * \param line to parse the keys from
+ * \param with which offset the keys begin within the line
+ */
+void TremoloParser::parseAtomDataKeysLine(string line, int offset) {
+  string keyword;
+  stringstream lineStream;
+
+  lineStream << line.substr(offset);
+  while (lineStream.good()) {
+    lineStream >> keyword;
+    if (knownKeys[keyword.substr(0, keyword.find("="))] == TremoloKey::noKey) {
+      // TODO: throw exception about unknown key
+      cout << "Unknown key: " << keyword << " is not part of the tremolo format specification." << endl;
+      break;
+    }
+    usedFields.push_back(keyword);
+  }
+}
+
+/**
+ * Reads one data line of a tremolo file and interprets it according to the keys
+ * obtained from the ATOMDATA line.
+ *
+ * \param line to parse as an atom
+ */
+void TremoloParser::readAtomDataLine(string line) {
+  vector<string>::iterator it;
+  stringstream lineStream;
+  atom* newAtom = World::getInstance().createAtom();
+  TremoloAtomInfoContainer *atomInfo = NULL;
+  additionalAtomData[newAtom->getId()] = *(new TremoloAtomInfoContainer);
+  atomInfo = &additionalAtomData[newAtom->getId()];
+  TremoloKey::atomDataKey currentField;
+  string word;
+  int oldId;
+
+  lineStream << line;
+  for (it = usedFields.begin(); it < usedFields.end(); it++) {
+    currentField = knownKeys[it->substr(0, it->find("="))];
+    switch (currentField) {
+      case TremoloKey::x :
+        // for the moment, assume there are always three dimensions
+        lineStream >> newAtom->x[0];
+        lineStream >> newAtom->x[1];
+        lineStream >> newAtom->x[2];
+        break;
+      case TremoloKey::u :
+        // for the moment, assume there are always three dimensions
+        lineStream >> newAtom->v[0];
+        lineStream >> newAtom->v[1];
+        lineStream >> newAtom->v[2];
+        break;
+      case TremoloKey::Type :
+        char type[3];
+        lineStream >> type;
+        newAtom->setType(World::getInstance().getPeriode()->FindElement(type));
+        ASSERT(newAtom->getType(), "Type was not set for this atom");
+        break;
+      case TremoloKey::Id :
+        lineStream >> oldId;
+        atomIdMap[oldId] = newAtom->getId();
+        break;
+      case TremoloKey::neighbors :
+        readNeighbors(&lineStream,
+            atoi(it->substr(it->find("=") + 1, 1).c_str()), newAtom->getId());
+        break;
+      default :
+        lineStream >> word;
+        atomInfo->set(currentField, word);
+        break;
+    }
+  }
+}
+
+/**
+ * Reads neighbor information for one atom from the input.
+ *
+ * \param stream where to read the information from
+ * \param number of neighbors to read
+ * \param world id of the atom the information belongs to
+ */
+void TremoloParser::readNeighbors(stringstream* line, int numberOfNeighbors, int atomId) {
+  int neighborId = 0;
+  for (int i = 0; i < numberOfNeighbors; i++) {
+    *line >> neighborId;
+    // 0 is used to fill empty neighbor positions in the tremolo file.
+    if (neighborId > 0) {
+      additionalAtomData[atomId].neighbors.push_back(neighborId);
+    }
+  }
+}
+
+/**
+ * Checks whether the provided name is within the list of used fields.
+ *
+ * \param field name to check
+ *
+ * \return true if the field name is used
+ */
+bool TremoloParser::isUsedField(string fieldName) {
+  bool fieldNameExists = false;
+  for (vector<string>::iterator usedField = usedFields.begin(); usedField != usedFields.end(); usedField++) {
+    if (usedField->substr(0, usedField->find("=")) == fieldName)
+      fieldNameExists = true;
+  }
+
+  return fieldNameExists;
+}
+
+
+/**
+ * Adds the collected neighbor information to the atoms in the world. The atoms
+ * are found by their current ID and mapped to the corresponding atoms with the
+ * Id found in the parsed file.
+ */
+void TremoloParser::processNeighborInformation() {
+  if (!isUsedField("neighbors")) {
+    return;
+  }
+
+  for(map<int, TremoloAtomInfoContainer>::iterator currentInfo = additionalAtomData.begin();
+    currentInfo != additionalAtomData.end(); currentInfo++
+  ) {
+    for(vector<int>::iterator neighbor = currentInfo->second.neighbors.begin();
+      neighbor != currentInfo->second.neighbors.end(); neighbor++
+    ) {
+      World::getInstance().getAtom(AtomById(currentInfo->first))
+          ->addBond(World::getInstance().getAtom(AtomById(atomIdMap[*neighbor])));
+    }
+  }
+}
+
+/**
+ * Replaces atom IDs read from the file by the corresponding world IDs. All IDs
+ * IDs of the input string will be replaced; expected separating characters are
+ * "-" and ",".
+ *
+ * \param string in which atom IDs should be adapted
+ *
+ * \return input string with modified atom IDs
+ */
+string TremoloParser::adaptIdDependentDataString(string data) {
+  // there might be no IDs
+  if (data == "-") {
+    return "-";
+  }
+
+  char separator;
+  int id;
+  stringstream line, result;
+  line << data;
+
+  line >> id;
+  result << atomIdMap[id];
+  while (line.good()) {
+    line >> separator >> id;
+    result << separator << atomIdMap[id];
+  }
+
+  return result.str();
+}
+
+/**
+ * Corrects the atom IDs in each imprData entry to the corresponding world IDs
+ * as they might differ from the originally read IDs.
+ */
+void TremoloParser::adaptImprData() {
+  if (!isUsedField("imprData")) {
+    return;
+  }
+
+  for(map<int, TremoloAtomInfoContainer>::iterator currentInfo = additionalAtomData.begin();
+    currentInfo != additionalAtomData.end(); currentInfo++
+  ) {
+    currentInfo->second.imprData = adaptIdDependentDataString(currentInfo->second.imprData);
+  }
+}
+
+/**
+ * Corrects the atom IDs in each torsion entry to the corresponding world IDs
+ * as they might differ from the originally read IDs.
+ */
+void TremoloParser::adaptTorsion() {
+  if (!isUsedField("torsion")) {
+    return;
+  }
+
+  for(map<int, TremoloAtomInfoContainer>::iterator currentInfo = additionalAtomData.begin();
+    currentInfo != additionalAtomData.end(); currentInfo++
+  ) {
+    currentInfo->second.torsion = adaptIdDependentDataString(currentInfo->second.torsion);
+  }
+}
+
+
+TremoloAtomInfoContainer::TremoloAtomInfoContainer() {
+  F = "0";
+  stress = "0";
+  imprData = "-";
+  GroupMeasureTypeNo = "0";
+  extType = "-";
+  name = "-";
+  resName = "-";
+  chainID = "0";
+  resSeq = "0";
+  occupancy = "0";
+  tempFactor = "0";
+  segID = "0";
+  Charge = "0";
+  charge = "0";
+  GrpTypeNo = "0";
+  torsion = "-";
+  neighbors = vector<int>(0, 5);
+}
+
+void TremoloAtomInfoContainer::set(TremoloKey::atomDataKey key, string value) {
+  switch (key) {
+    case TremoloKey::F :
+      F = value;
+      break;
+    case TremoloKey::stress :
+      stress = value;
+     break;
+    case TremoloKey::imprData :
+      imprData = value;
+      break;
+    case TremoloKey::GroupMeasureTypeNo :
+      GroupMeasureTypeNo = value;
+      break;
+    case TremoloKey::extType :
+      extType = value;
+      break;
+    case TremoloKey::name :
+      name = value;
+      break;
+    case TremoloKey::resName :
+      resName = value;
+      break;
+    case TremoloKey::chainID :
+      chainID = value;
+      break;
+    case TremoloKey::resSeq :
+      resSeq = value;
+      break;
+    case TremoloKey::occupancy :
+      occupancy = value;
+      break;
+    case TremoloKey::tempFactor :
+      tempFactor = value;
+      break;
+    case TremoloKey::segID :
+      segID = value;
+      break;
+    case TremoloKey::Charge :
+      Charge = value;
+      break;
+    case TremoloKey::charge :
+      charge = value;
+      break;
+    case TremoloKey::GrpTypeNo :
+      GrpTypeNo = value;
+      break;
+    case TremoloKey::torsion :
+      torsion = value;
+      break;
+    default :
+      cout << "Unknown key: " << key << ", value: " << value << endl;
+      break;
+  }
+}
+
+string TremoloAtomInfoContainer::get(TremoloKey::atomDataKey key) {
+  switch (key) {
+    case TremoloKey::F :
+      return F;
+    case TremoloKey::stress :
+      return stress;
+    case TremoloKey::imprData :
+      return imprData;
+    case TremoloKey::GroupMeasureTypeNo :
+      return GroupMeasureTypeNo;
+    case TremoloKey::extType :
+      return extType;
+    case TremoloKey::name :
+      return name;
+    case TremoloKey::resName :
+      return resName;
+    case TremoloKey::chainID :
+      return chainID;
+    case TremoloKey::resSeq :
+      return resSeq;
+    case TremoloKey::occupancy :
+      return occupancy;
+    case TremoloKey::tempFactor :
+      return tempFactor;
+    case TremoloKey::segID :
+      return segID;
+    case TremoloKey::Charge :
+      return Charge;
+    case TremoloKey::charge :
+      return charge;
+    case TremoloKey::GrpTypeNo :
+      return GrpTypeNo;
+    case TremoloKey::torsion :
+      return torsion;
+    default :
+      cout << "Unknown key: " << key << endl;
+      return "";
+  }
+}
+
Index: src/Parser/TremoloParser.hpp
===================================================================
--- src/Parser/TremoloParser.hpp	(revision f941b14c7a92d23575eccdfcd7bbb7ef127d1bad)
+++ src/Parser/TremoloParser.hpp	(revision f941b14c7a92d23575eccdfcd7bbb7ef127d1bad)
@@ -0,0 +1,125 @@
+/*
+ * TremoloParser.hpp
+ *
+ *  Created on: Mar 2, 2010
+ *      Author: metzler
+ */
+
+#ifndef TREMOLOPARSER_HPP_
+#define TREMOLOPARSER_HPP_
+
+#include <string>
+#include "FormatParser.hpp"
+
+/**
+ * Known keys for the ATOMDATA line.
+ */
+class TremoloKey {
+public:
+  enum atomDataKey {
+    noKey,
+    x,
+    u,
+    F,
+    stress,
+    Id,
+    neighbors,
+    imprData,
+    GroupMeasureTypeNo,
+    Type,
+    extType,
+    name,
+    resName,
+    chainID,
+    resSeq,
+    occupancy,
+    tempFactor,
+    segID,
+    Charge,
+    charge,
+    GrpTypeNo,
+    torsion
+  };
+};
+
+/**
+ * Holds tremolo-specific information which is not store in the atom class.
+ */
+class TremoloAtomInfoContainer {
+public:
+  TremoloAtomInfoContainer();
+  void set(TremoloKey::atomDataKey key, std::string value);
+  std::string get(TremoloKey::atomDataKey key);
+  std::string F;
+  std::string stress;
+  std::string imprData;
+  std::string GroupMeasureTypeNo;
+  std::string extType;
+  std::string name;
+  std::string resName;
+  std::string chainID;
+  std::string resSeq;
+  std::string occupancy;
+  std::string tempFactor;
+  std::string segID;
+  std::string Charge;
+  std::string charge;
+  std::string GrpTypeNo;
+  std::string torsion;
+  std::vector<int> neighbors;
+};
+
+/**
+ * Loads a tremolo file into the World and saves the World as a tremolo file.
+ */
+class TremoloParser : public FormatParser
+{
+public:
+  TremoloParser();
+  ~TremoloParser();
+  void load(std::istream* file);
+  void save(std::ostream* file);
+  void setFieldsForSave(std::string atomDataLine);
+
+
+private:
+  void readAtomDataLine(string line);
+  void parseAtomDataKeysLine(string line, int offset);
+  void readNeighbors(std::stringstream* line, int numberOfNeighbors, int atomId);
+  void processNeighborInformation();
+  void adaptImprData();
+  void adaptTorsion();
+  std::string adaptIdDependentDataString(std::string data);
+  bool isUsedField(std::string fieldName);
+  void writeNeighbors(std::ostream* file, int numberOfNeighbors, atom* currentAtom);
+  void saveLine(std::ostream* file, atom* currentAtom);
+
+  /**
+   * Map to associate the known keys with numbers.
+   */
+  std::map<std::string, TremoloKey::atomDataKey> knownKeys;
+
+  /**
+   * Fields used in the tremolo file.
+   */
+  std::vector<std::string> usedFields;
+
+  /**
+   * Data which is currently not stored in atoms but was provided by the input
+   * file.
+   */
+  std::map<int, TremoloAtomInfoContainer> additionalAtomData;
+
+  /**
+   * Default additional atom data.
+   */
+  TremoloAtomInfoContainer defaultAdditionalData;
+
+  /**
+   * Maps original atom IDs received from the parsed file to atom IDs in the
+   * world.
+   */
+  std::map<int, int> atomIdMap;
+};
+
+#endif /* TREMOLOPARSER_HPP_ */
Index: src/Parser/XyzParser.cpp
===================================================================
--- src/Parser/XyzParser.cpp	(revision f941b14c7a92d23575eccdfcd7bbb7ef127d1bad)
+++ src/Parser/XyzParser.cpp	(revision f941b14c7a92d23575eccdfcd7bbb7ef127d1bad)
@@ -0,0 +1,64 @@
+/*
+ * XyzParser.cpp
+ *
+ *  Created on: Mar 2, 2010
+ *      Author: metzler
+ */
+
+#include "XyzParser.hpp"
+#include "World.hpp"
+#include "atom.hpp"
+#include "element.hpp"
+#include "periodentafel.hpp"
+
+using namespace std;
+
+/**
+ * Constructor.
+ */
+XyzParser::XyzParser() {
+  comment = "";
+}
+
+/**
+ * Destructor.
+ */
+XyzParser::~XyzParser() {
+  delete(&comment);
+}
+
+/**
+ * Loads an XYZ file into the World.
+ *
+ * \param XYZ file
+ */
+void XyzParser::load(istream* file) {
+  atom* newAtom;
+  int numberOfAtoms;
+  char commentBuffer[512], type[3];
+
+  // the first line tells number of atoms, the second line is always a comment
+  *file >> numberOfAtoms >> ws;
+  file->getline(commentBuffer, 512);
+  comment = commentBuffer;
+
+  for (int i = 0; i < numberOfAtoms; i++) {
+    newAtom = World::getInstance().createAtom();
+    *file >> type >> ws >> newAtom->x[0] >> ws >> newAtom->x[1] >> ws >> newAtom->x[2];
+    newAtom->setType(World::getInstance().getPeriode()->FindElement(type));
+  }
+}
+
+/**
+ * Saves the current state of the World into the given XYZ file.
+ *
+ * \param XYZ file
+ */
+void XyzParser::save(ostream* file) {
+  *file << World::getInstance().numAtoms() << endl << comment << endl;
+
+  vector<atom*> atoms = World::getInstance().getAllAtoms();
+  for(vector<atom*>::iterator it = atoms.begin(); it != atoms.end(); it++) {
+    *file << fixed << (*it)->getType()->symbol << "\t" << (*it)->x[0] << "\t" << (*it)->x[1] << "\t" << (*it)->x[2] << endl;
+  }
+}
Index: src/Parser/XyzParser.hpp
===================================================================
--- src/Parser/XyzParser.hpp	(revision f941b14c7a92d23575eccdfcd7bbb7ef127d1bad)
+++ src/Parser/XyzParser.hpp	(revision f941b14c7a92d23575eccdfcd7bbb7ef127d1bad)
@@ -0,0 +1,28 @@
+/*
+ * XyzParser.hpp
+ *
+ *  Created on: Mar 2, 2010
+ *      Author: metzler
+ */
+
+#ifndef XYZPARSER_HPP_
+#define XYZPARSER_HPP_
+
+#include <string>
+#include "FormatParser.hpp"
+
+/**
+ * Parser for XYZ files.
+ */
+class XyzParser : public FormatParser {
+public:
+  XyzParser();
+  ~XyzParser();
+  void load(std::istream* file);
+  void save(std::ostream* file);
+
+private:
+  std::string comment;
+};
+
+#endif /* XYZPARSER_HPP_ */
Index: src/UIElements/CommandLineDialog.cpp
===================================================================
--- src/UIElements/CommandLineDialog.cpp	(revision f941b14c7a92d23575eccdfcd7bbb7ef127d1bad)
+++ src/UIElements/CommandLineDialog.cpp	(revision f941b14c7a92d23575eccdfcd7bbb7ef127d1bad)
@@ -0,0 +1,259 @@
+/*
+ * CommandLineDialog.cpp
+ *
+ *  Created on: May 8, 2010
+ *      Author: heber
+ */
+
+
+#include <cassert>
+#include <iostream>
+
+#include <Descriptors/AtomDescriptor.hpp>
+#include <Descriptors/AtomIdDescriptor.hpp>
+#include <Descriptors/MoleculeDescriptor.hpp>
+#include <Descriptors/MoleculeIdDescriptor.hpp>
+#include "UIElements/CommandLineDialog.hpp"
+
+#include "element.hpp"
+#include "periodentafel.hpp"
+#include "CommandLineParser.hpp"
+#include "defs.hpp"
+#include "log.hpp"
+#include "periodentafel.hpp"
+#include "verbose.hpp"
+#include "World.hpp"
+
+#include "atom.hpp"
+#include "element.hpp"
+#include "molecule.hpp"
+#include "vector.hpp"
+
+using namespace std;
+
+
+CommandLineDialog::CommandLineDialog()
+{
+}
+
+CommandLineDialog::~CommandLineDialog()
+{
+}
+
+
+void CommandLineDialog::queryEmpty(const char* title, string _description){
+  registerQuery(new EmptyCommandLineQuery(title, _description));
+}
+
+void CommandLineDialog::queryInt(const char* title, int* target, string _description){
+  registerQuery(new IntCommandLineQuery(title,target, _description));
+}
+
+void CommandLineDialog::queryBoolean(const char* title, bool* target, string _description){
+  registerQuery(new BooleanCommandLineQuery(title,target, _description));
+}
+
+void CommandLineDialog::queryDouble(const char* title, double* target, string _description){
+  registerQuery(new DoubleCommandLineQuery(title,target, _description));
+}
+
+void CommandLineDialog::queryString(const char* title, string* target, string _description){
+  registerQuery(new StringCommandLineQuery(title,target, _description));
+}
+
+void CommandLineDialog::queryAtom(const char* title, atom **target, string _description) {
+  registerQuery(new AtomCommandLineQuery(title,target, _description));
+}
+
+void CommandLineDialog::queryMolecule(const char* title, molecule **target, string _description) {
+  registerQuery(new MoleculeCommandLineQuery(title,target, _description));
+}
+
+void CommandLineDialog::queryVector(const char* title, Vector *target,const double *const cellSize, bool check, string _description) {
+  registerQuery(new VectorCommandLineQuery(title,target,cellSize,check, _description));
+}
+
+void CommandLineDialog::queryBox(const char* title, double ** const cellSize, string _description) {
+  registerQuery(new BoxCommandLineQuery(title,cellSize,_description));
+}
+
+void CommandLineDialog::queryElement(const char* title, const element **target, string _description){
+  registerQuery(new ElementCommandLineQuery(title,target, _description));
+}
+
+/************************** Query Infrastructure ************************/
+
+CommandLineDialog::EmptyCommandLineQuery::EmptyCommandLineQuery(string title, string _description) :
+    Dialog::EmptyQuery(title, _description)
+{}
+
+CommandLineDialog::EmptyCommandLineQuery::~EmptyCommandLineQuery() {}
+
+bool CommandLineDialog::EmptyCommandLineQuery::handle() {
+  cout << "Message of " << getTitle() << ":\n" << getDescription() << "\n";
+  return true;
+}
+
+CommandLineDialog::IntCommandLineQuery::IntCommandLineQuery(string title,int *_target, string _description) :
+    Dialog::IntQuery(title,_target, _description)
+{}
+
+CommandLineDialog::IntCommandLineQuery::~IntCommandLineQuery() {}
+
+bool CommandLineDialog::IntCommandLineQuery::handle() {
+  if (CommandLineParser::getInstance().vm.count(getTitle())) {
+    tmp = CommandLineParser::getInstance().vm[getTitle()].as<int>();
+    return true;
+  } else
+    return false;
+}
+
+CommandLineDialog::BooleanCommandLineQuery::BooleanCommandLineQuery(string title,bool *_target, string _description) :
+    Dialog::BooleanQuery(title,_target, _description)
+{}
+
+CommandLineDialog::BooleanCommandLineQuery::~BooleanCommandLineQuery() {}
+
+bool CommandLineDialog::BooleanCommandLineQuery::handle() {
+  bool badInput = false;
+  char input = ' ';
+  do{
+    badInput = false;
+    Log() << Verbose(0) << getTitle();
+    cin >> input;
+    if ((input == 'y' ) || (input == 'Y')) {
+      tmp = true;
+    } else if ((input == 'n' ) || (input == 'N')) {
+      tmp = false;
+    } else {
+      badInput=true;
+      cin.clear();
+      cin.ignore(std::numeric_limits<streamsize>::max(),'\n');
+      Log() << Verbose(0) << "Input was not of [yYnN]!" << endl;
+    }
+  } while(badInput);
+  // clear the input buffer of anything still in the line
+  cin.ignore(std::numeric_limits<streamsize>::max(),'\n');
+  return true;
+}
+
+CommandLineDialog::StringCommandLineQuery::StringCommandLineQuery(string title,string *_target, string _description) :
+    Dialog::StringQuery(title,_target, _description)
+{}
+
+CommandLineDialog::StringCommandLineQuery::~StringCommandLineQuery() {}
+
+bool CommandLineDialog::StringCommandLineQuery::handle() {
+  if (CommandLineParser::getInstance().vm.count(getTitle())) {
+    tmp = CommandLineParser::getInstance().vm[getTitle()].as<string>();
+    return true;
+  } else
+    return false;
+}
+
+CommandLineDialog::DoubleCommandLineQuery::DoubleCommandLineQuery(string title,double *_target, string _description) :
+    Dialog::DoubleQuery(title,_target, _description)
+{}
+
+CommandLineDialog::DoubleCommandLineQuery::~DoubleCommandLineQuery() {}
+
+bool CommandLineDialog::DoubleCommandLineQuery::handle() {
+  if (CommandLineParser::getInstance().vm.count(getTitle())) {
+    tmp = CommandLineParser::getInstance().vm[getTitle()].as<double>();
+    return true;
+  } else
+    return false;
+}
+
+CommandLineDialog::AtomCommandLineQuery::AtomCommandLineQuery(string title, atom **_target, string _description) :
+    Dialog::AtomQuery(title,_target, _description)
+{}
+
+CommandLineDialog::AtomCommandLineQuery::~AtomCommandLineQuery() {}
+
+bool CommandLineDialog::AtomCommandLineQuery::handle() {
+  int IdxOfAtom = -1;
+  if (CommandLineParser::getInstance().vm.count(getTitle())) {
+    IdxOfAtom = CommandLineParser::getInstance().vm[getTitle()].as<int>();
+    tmp = World::getInstance().getAtom(AtomById(IdxOfAtom));
+    return true;
+  } else
+    return false;
+}
+
+CommandLineDialog::MoleculeCommandLineQuery::MoleculeCommandLineQuery(string title, molecule **_target, string _description) :
+    Dialog::MoleculeQuery(title,_target, _description)
+{}
+
+CommandLineDialog::MoleculeCommandLineQuery::~MoleculeCommandLineQuery() {}
+
+bool CommandLineDialog::MoleculeCommandLineQuery::handle() {
+  int IdxOfMol = -1;
+  if (CommandLineParser::getInstance().vm.count(getTitle())) {
+    IdxOfMol = CommandLineParser::getInstance().vm[getTitle()].as<int>();
+    tmp = World::getInstance().getMolecule(MoleculeById(IdxOfMol));
+    return true;
+  } else
+    return false;
+}
+
+CommandLineDialog::VectorCommandLineQuery::VectorCommandLineQuery(string title, Vector *_target, const double *const _cellSize, bool _check, string _description) :
+    Dialog::VectorQuery(title,_target,_cellSize,_check, _description)
+{}
+
+CommandLineDialog::VectorCommandLineQuery::~VectorCommandLineQuery()
+{}
+
+bool CommandLineDialog::VectorCommandLineQuery::handle() {
+  vector<double> temp;
+  if (CommandLineParser::getInstance().vm.count(getTitle())) {
+    temp = CommandLineParser::getInstance().vm[getTitle()].as<vector<double> >();
+    assert((temp.size() == 3) && "Vector from command line does not have three components.");
+    for (int i=0;i<NDIM;i++)
+      tmp->at(i) = temp[i];
+    return true;
+  } else
+    return false;
+}
+
+
+CommandLineDialog::BoxCommandLineQuery::BoxCommandLineQuery(string title, double ** const _cellSize, string _description) :
+    Dialog::BoxQuery(title,_cellSize, _description)
+{}
+
+CommandLineDialog::BoxCommandLineQuery::~BoxCommandLineQuery()
+{}
+
+bool CommandLineDialog::BoxCommandLineQuery::handle() {
+  vector<double> temp;
+  if (CommandLineParser::getInstance().vm.count(getTitle())) {
+    temp = CommandLineParser::getInstance().vm[getTitle()].as<vector<double> >();
+    assert((temp.size() == 6) && "Symmetric box matrix from command line does not have six components.");
+    for (int i=0;i<6;i++)
+      tmp[i] = temp[i];
+    return true;
+  } else
+    return false;
+}
+
+CommandLineDialog::ElementCommandLineQuery::ElementCommandLineQuery(string title, const element **target, string _description) :
+    Dialog::ElementQuery(title,target, _description)
+{}
+
+CommandLineDialog::ElementCommandLineQuery::~ElementCommandLineQuery()
+{}
+
+bool CommandLineDialog::ElementCommandLineQuery::handle() {
+  // TODO: vector of ints and removing first is not correctly implemented yet. How to remove from a vector?
+  int Z;
+  if (CommandLineParser::getInstance().vm.count(getTitle())) {
+    vector<int> AllElements = CommandLineParser::getInstance().vm[getTitle()].as< vector<int> >();
+    vector<int>::iterator ElementRunner = AllElements.begin();
+    Z = *ElementRunner;
+    // TODO: So far, this does not really erase the element in the parsed list.
+    AllElements.erase(ElementRunner);
+    tmp = World::getInstance().getPeriode()->FindElement(Z);
+    return true;
+  } else
+    return false;
+}
Index: src/UIElements/CommandLineDialog.hpp
===================================================================
--- src/UIElements/CommandLineDialog.hpp	(revision f941b14c7a92d23575eccdfcd7bbb7ef127d1bad)
+++ src/UIElements/CommandLineDialog.hpp	(revision f941b14c7a92d23575eccdfcd7bbb7ef127d1bad)
@@ -0,0 +1,113 @@
+/*
+ * CommandLineDialog.hpp
+ *
+ *  Created on: May 8, 2010
+ *      Author: heber
+ */
+
+#ifndef COMMANDLINEDIALOG_HPP_
+#define COMMANDLINEDIALOG_HPP_
+
+#include <string>
+
+class atom;
+class element;
+class molecule;
+class Vector;
+
+#include "UIElements/Dialog.hpp"
+
+/** CommandLineUIFactory implementation of the Dialog.
+ * The idea here is that for each query the parsed command line options are used instead.
+ */
+class CommandLineDialog : public Dialog
+{
+public:
+  CommandLineDialog();
+  virtual ~CommandLineDialog();
+
+  virtual void queryEmpty(const char *, std::string = "");
+  virtual void queryInt(const char *, int *, std::string = "");
+  virtual void queryBoolean(const char *, bool *, std::string = "");
+  virtual void queryString(const char*, std::string *, std::string = "");
+  virtual void queryDouble(const char*, double*, std::string = "");
+  virtual void queryAtom(const char*,atom**, std::string = "");
+  virtual void queryMolecule(const char*,molecule**,std::string = "");
+  virtual void queryVector(const char*,Vector *,const double * const,bool, std::string = "");
+  virtual void queryBox(const char*,double ** const, std::string = "");
+  virtual void queryElement(const char*,const element **, std::string = "");
+
+protected:
+  // specialized stuff for text queries
+  class EmptyCommandLineQuery : public Dialog::EmptyQuery {
+  public:
+    EmptyCommandLineQuery(std::string title, std::string _description = "");
+    virtual ~EmptyCommandLineQuery();
+    virtual bool handle();
+  };
+
+  class IntCommandLineQuery : public Dialog::IntQuery {
+  public:
+    IntCommandLineQuery(std::string title, int *_target, std::string _description = "");
+    virtual ~IntCommandLineQuery();
+    virtual bool handle();
+  };
+
+  class BooleanCommandLineQuery : public Dialog::BooleanQuery {
+  public:
+    BooleanCommandLineQuery(std::string title, bool *_target, std::string _description = "");
+    virtual ~BooleanCommandLineQuery();
+    virtual bool handle();
+  };
+
+  class DoubleCommandLineQuery : public Dialog::DoubleQuery {
+  public:
+    DoubleCommandLineQuery(std::string title, double *_target, std::string _description = "");
+    virtual ~DoubleCommandLineQuery();
+    virtual bool handle();
+  };
+
+  class StringCommandLineQuery : public Dialog::StringQuery {
+  public:
+    StringCommandLineQuery(std::string title, std::string *_target, std::string _description = "");
+    virtual ~StringCommandLineQuery();
+    virtual bool handle();
+  };
+
+  class AtomCommandLineQuery : public Dialog::AtomQuery {
+  public:
+    AtomCommandLineQuery(std::string title, atom **_target, std::string _description = "");
+    virtual ~AtomCommandLineQuery();
+    virtual bool handle();
+  };
+
+  class MoleculeCommandLineQuery : public Dialog::MoleculeQuery {
+  public:
+    MoleculeCommandLineQuery(std::string title, molecule **_target, std::string _description = "");
+    virtual ~MoleculeCommandLineQuery();
+    virtual bool handle();
+  };
+
+  class VectorCommandLineQuery : public Dialog::VectorQuery {
+  public:
+    VectorCommandLineQuery(std::string title,Vector *_target,const double *const _cellSize,bool _check, std::string _description = "");
+    virtual ~VectorCommandLineQuery();
+    virtual bool handle();
+  };
+
+  class BoxCommandLineQuery : public Dialog::BoxQuery {
+  public:
+    BoxCommandLineQuery(std::string title,double ** const _cellSize, std::string _description = "");
+    virtual ~BoxCommandLineQuery();
+    virtual bool handle();
+  };
+
+  class ElementCommandLineQuery : public Dialog::ElementQuery {
+  public:
+    ElementCommandLineQuery(std::string title, const element **_target, std::string _description = "");
+    virtual ~ElementCommandLineQuery();
+    virtual bool handle();
+  };
+};
+
+#endif /* COMMANDLINEDIALOG_HPP_ */
Index: src/UIElements/CommandLineStatusIndicator.cpp
===================================================================
--- src/UIElements/CommandLineStatusIndicator.cpp	(revision f941b14c7a92d23575eccdfcd7bbb7ef127d1bad)
+++ src/UIElements/CommandLineStatusIndicator.cpp	(revision f941b14c7a92d23575eccdfcd7bbb7ef127d1bad)
@@ -0,0 +1,57 @@
+/*
+ * CommandLineStatusIndicator.cpp
+ *
+ *  Created on: May 8, 2010
+ *      Author: heber
+ */
+
+
+#include "CommandLineStatusIndicator.hpp"
+
+#include <iostream>
+
+#include "Actions/Process.hpp"
+
+using namespace std;
+
+CommandLineStatusIndicator::CommandLineStatusIndicator()
+{
+  Process::AddObserver(this);
+}
+
+CommandLineStatusIndicator::~CommandLineStatusIndicator()
+{
+  Process::RemoveObserver(this);
+}
+
+void CommandLineStatusIndicator::update(Observable *subject){
+  Process *proc;
+  // we are only observing Processes
+  if((proc=dynamic_cast<Process*>(subject))){
+    // see what kind of progress we have to display
+    if(proc->getMaxSteps()>0){
+      if(!proc->doesStop()){
+        cout << "Busy (" << proc->getName() << ") ";
+        // we can show a percentage done
+        cout << (int)proc->getDoneRatio() << "% done" << endl;
+      }
+    }
+    else{
+      // we only show some kind of busy animation
+      if(proc->doesStart()){
+        cout << "Busy (" << proc->getName() << ")";
+      }
+      if(!proc->doesStop()){
+        cout << ".";
+      }
+      else {
+        cout << endl;
+      }
+    }
+  }
+}
+
+void CommandLineStatusIndicator::subjectKilled(Observable *subject){
+
+}
+
Index: src/UIElements/CommandLineStatusIndicator.hpp
===================================================================
--- src/UIElements/CommandLineStatusIndicator.hpp	(revision f941b14c7a92d23575eccdfcd7bbb7ef127d1bad)
+++ src/UIElements/CommandLineStatusIndicator.hpp	(revision f941b14c7a92d23575eccdfcd7bbb7ef127d1bad)
@@ -0,0 +1,26 @@
+/*
+ * CommandLineStatusIndicator.hpp
+ *
+ *  Created on: May 8, 2010
+ *      Author: heber
+ */
+
+#ifndef COMMANDLINESTATUSINDICATOR_HPP_
+#define COMMANDLINESTATUSINDICATOR_HPP_
+
+#include "Patterns/Observer.hpp"
+
+class CommandLineStatusIndicator : public Observer
+{
+public:
+  CommandLineStatusIndicator();
+  virtual ~CommandLineStatusIndicator();
+
+  void update(Observable *subject);
+  void subjectKilled(Observable *subject);
+
+private:
+
+};
+
+#endif /* COMMANDLINESTATUSINDICATOR_HPP_ */
Index: src/UIElements/CommandLineUIFactory.cpp
===================================================================
--- src/UIElements/CommandLineUIFactory.cpp	(revision f941b14c7a92d23575eccdfcd7bbb7ef127d1bad)
+++ src/UIElements/CommandLineUIFactory.cpp	(revision f941b14c7a92d23575eccdfcd7bbb7ef127d1bad)
@@ -0,0 +1,32 @@
+/*
+ * CommandLineUIFactory.cpp
+ *
+ *  Created on: May 8, 2010
+ *      Author: heber
+ */
+
+
+#include "UIElements/CommandLineUIFactory.hpp"
+#include "UIElements/CommandLineWindow.hpp"
+#include "UIElements/CommandLineDialog.hpp"
+
+
+CommandLineUIFactory::CommandLineUIFactory()
+{
+  // TODO Auto-generated constructor stub
+
+}
+
+CommandLineUIFactory::~CommandLineUIFactory()
+{
+  // TODO Auto-generated destructor stub
+}
+
+
+Dialog* CommandLineUIFactory::makeDialog() {
+  return new CommandLineDialog();
+}
+
+MainWindow* CommandLineUIFactory::makeMainWindow() {
+  return new CommandLineWindow();
+}
Index: src/UIElements/CommandLineUIFactory.hpp
===================================================================
--- src/UIElements/CommandLineUIFactory.hpp	(revision f941b14c7a92d23575eccdfcd7bbb7ef127d1bad)
+++ src/UIElements/CommandLineUIFactory.hpp	(revision f941b14c7a92d23575eccdfcd7bbb7ef127d1bad)
@@ -0,0 +1,28 @@
+/*
+ * CommandLineUIFactory.hpp
+ *
+ *  Created on: May 8, 2010
+ *      Author: heber
+ */
+
+#ifndef COMMANDLINEUIFACTORY_HPP_
+#define COMMANDLINEUIFACTORY_HPP_
+
+#include "UIElements/UIFactory.hpp"
+
+class CommandLineUIFactory : public UIFactory
+{
+friend class UIFactory;
+
+public:
+  virtual ~CommandLineUIFactory();
+
+  virtual Dialog* makeDialog();
+  virtual MainWindow* makeMainWindow();
+
+protected:
+  CommandLineUIFactory();
+};
+
+
+#endif /* COMMANDLINEUIFACTORY_HPP_ */
Index: src/UIElements/CommandLineWindow.cpp
===================================================================
--- src/UIElements/CommandLineWindow.cpp	(revision f941b14c7a92d23575eccdfcd7bbb7ef127d1bad)
+++ src/UIElements/CommandLineWindow.cpp	(revision f941b14c7a92d23575eccdfcd7bbb7ef127d1bad)
@@ -0,0 +1,159 @@
+/*
+ * CommandLineWindow.cpp
+ *
+ *  Created on: May 8, 2010
+ *      Author: heber
+ */
+
+#include <boost/bind.hpp>
+
+#include "UIElements/CommandLineWindow.hpp"
+#include "UIElements/CommandLineStatusIndicator.hpp"
+
+#include "Actions/ActionRegistry.hpp"
+#include "Actions/AnalysisAction/PairCorrelationAction.hpp"
+#include "Actions/AnalysisAction/PairCorrelationToPointAction.hpp"
+#include "Actions/AnalysisAction/PairCorrelationToSurfaceAction.hpp"
+#include "Actions/AtomAction/AddAction.hpp"
+#include "Actions/AtomAction/ChangeElementAction.hpp"
+#include "Actions/AtomAction/RemoveAction.hpp"
+#include "Actions/CmdAction/BondLengthTableAction.hpp"
+#include "Actions/CmdAction/ElementDbAction.hpp"
+#include "Actions/CmdAction/FastParsingAction.hpp"
+#include "Actions/CmdAction/HelpAction.hpp"
+#include "Actions/CmdAction/VerboseAction.hpp"
+#include "Actions/CmdAction/VersionAction.hpp"
+#include "Actions/FragmentationAction/DepthFirstSearchAction.hpp"
+#include "Actions/FragmentationAction/SubgraphDissectionAction.hpp"
+#include "Actions/MoleculeAction/BondFileAction.hpp"
+#include "Actions/MoleculeAction/ChangeNameAction.hpp"
+#include "Actions/MoleculeAction/FillWithMoleculeAction.hpp"
+#include "Actions/MoleculeAction/LinearInterpolationofTrajectoriesAction.hpp"
+#include "Actions/MoleculeAction/SaveAdjacencyAction.hpp"
+#include "Actions/MoleculeAction/SaveBondsAction.hpp"
+#include "Actions/MoleculeAction/SaveTemperatureAction.hpp"
+#include "Actions/MoleculeAction/VerletIntegrationAction.hpp"
+#include "Actions/ParserAction/LoadXyzAction.hpp"
+#include "Actions/ParserAction/SaveXyzAction.hpp"
+#include "Actions/TesselationAction/ConvexEnvelopeAction.hpp"
+#include "Actions/TesselationAction/NonConvexEnvelopeAction.hpp"
+#include "Actions/WorldAction/AddEmptyBoundaryAction.hpp"
+#include "Actions/WorldAction/BoundInBoxAction.hpp"
+#include "Actions/WorldAction/CenterInBoxAction.hpp"
+#include "Actions/WorldAction/CenterOnEdgeAction.hpp"
+#include "Actions/WorldAction/ChangeBoxAction.hpp"
+#include "Actions/WorldAction/RemoveSphereOfAtomsAction.hpp"
+#include "Actions/WorldAction/RepeatBoxAction.hpp"
+#include "Actions/WorldAction/ScaleBoxAction.hpp"
+#include "Actions/WorldAction/SetDefaultNameAction.hpp"
+#include "Actions/WorldAction/SetGaussianBasisAction.hpp"
+#include "CommandLineParser.hpp"
+
+#include <iostream>
+
+using namespace std;
+
+// TODO: see what code can be moved to a base class for Graphic and CommandLine Windows
+CommandLineWindow::CommandLineWindow()
+{
+  // create and register all command line callable actions
+  populateAnalysisActions();
+  populateAtomActions();
+  populateCmdActions();
+  populateFragmentationActions();
+  populateMoleculeActions();
+  populateParserActions();
+  populateTesselationActions();
+  populateWorldActions();
+
+  // Add status indicators etc...
+  statusIndicator = new CommandLineStatusIndicator();
+}
+
+CommandLineWindow::~CommandLineWindow()
+{
+  // go through all possible actions
+  for(std::map<const std::string,Action*>::iterator ActionRunner = ActionRegistry::getInstance().getBeginIter(); ActionRegistry::getInstance().getBeginIter() != ActionRegistry::getInstance().getEndIter(); ActionRunner = ActionRegistry::getInstance().getBeginIter()) {
+    ActionRegistry::getInstance().unregisterAction(ActionRunner->second);
+    delete(ActionRunner->second);
+  }
+
+  delete statusIndicator;
+}
+
+void CommandLineWindow::display() {
+  // go through all possible actions
+  for(std::map<const std::string,Action*>::iterator ActionRunner = ActionRegistry::getInstance().getBeginIter(); ActionRunner != ActionRegistry::getInstance().getEndIter(); ActionRunner++) {
+    // check whether action is present in command line
+    if (CommandLineParser::getInstance().vm.count(ActionRunner->first)) {
+      ActionRunner->second->call();
+    }
+  }
+}
+
+void CommandLineWindow::populateAnalysisActions()
+{
+  new AnalysisPairCorrelationAction();
+  new AnalysisPairCorrelationToPointAction();
+  new AnalysisPairCorrelationToSurfaceAction();
+}
+
+void CommandLineWindow::populateAtomActions()
+{
+  new AtomAddAction();
+  new AtomChangeElementAction();
+  new AtomRemoveAction();
+}
+
+void CommandLineWindow::populateCmdActions()
+{
+  new CommandLineBondLengthTableAction();
+  new CommandLineElementDbAction();
+  new CommandLineFastParsingAction();
+  new CommandLineHelpAction();
+  new CommandLineVerboseAction();
+  new CommandLineVersionAction();
+}
+
+void CommandLineWindow::populateFragmentationActions()
+{
+  new FragmentationDepthFirstSearchAction();
+}
+
+void CommandLineWindow::populateMoleculeActions()
+{
+  new MoleculeBondFileAction();
+  new MoleculeChangeNameAction();
+  new MoleculeFillWithMoleculeAction();
+  new MoleculeLinearInterpolationofTrajectoriesAction();
+  new MoleculeSaveAdjacencyAction();
+  new MoleculeSaveBondsAction();
+  new MoleculeSaveTemperatureAction();
+  new MoleculeVerletIntegrationAction();
+}
+
+void CommandLineWindow::populateParserActions()
+{
+  new ParserLoadXyzAction();
+  new ParserSaveXyzAction();
+}
+
+void CommandLineWindow::populateTesselationActions()
+{
+  new TesselationConvexEnvelopeAction();
+  new TesselationNonConvexEnvelopeAction();
+}
+
+void CommandLineWindow::populateWorldActions()
+{
+  new WorldAddEmptyBoundaryAction();
+  new WorldBoundInBoxAction();
+  new WorldCenterInBoxAction();
+  new WorldCenterOnEdgeAction();
+  new WorldChangeBoxAction();
+  new WorldRemoveSphereOfAtomsAction();
+  new WorldRepeatBoxAction();
+  new WorldScaleBoxAction();
+  new WorldSetDefaultNameAction();
+  new WorldSetGaussianBasisAction();
+}
Index: src/UIElements/CommandLineWindow.hpp
===================================================================
--- src/UIElements/CommandLineWindow.hpp	(revision f941b14c7a92d23575eccdfcd7bbb7ef127d1bad)
+++ src/UIElements/CommandLineWindow.hpp	(revision f941b14c7a92d23575eccdfcd7bbb7ef127d1bad)
@@ -0,0 +1,38 @@
+/*
+ * CommandLineWindow.hpp
+ *
+ *  Created on: May 8, 2010
+ *      Author: heber
+ */
+
+#ifndef COMMANDLINEWINDOW_HPP_
+#define COMMANDLINEWINDOW_HPP_
+
+#include "UIElements/MainWindow.hpp"
+
+class CommandLineStatusIndicator;
+
+class CommandLineWindow : public MainWindow
+{
+public:
+  CommandLineWindow();
+  virtual ~CommandLineWindow();
+
+  virtual void display();
+
+private:
+  // populaters
+  void populateAnalysisActions();
+  void populateAtomActions();
+  void populateCmdActions();
+  void populateFragmentationActions();
+  void populateMoleculeActions();
+  void populateParserActions();
+  void populateTesselationActions();
+  void populateWorldActions();
+
+  CommandLineStatusIndicator *statusIndicator;
+
+};
+
+#endif /* COMMANDLINEWINDOW_HPP_ */
Index: src/UIElements/Dialog.cpp
===================================================================
--- src/UIElements/Dialog.cpp	(revision 12872df33639e521d4b0225d6064ea91bd4f18e8)
+++ src/UIElements/Dialog.cpp	(revision f941b14c7a92d23575eccdfcd7bbb7ef127d1bad)
@@ -10,4 +10,7 @@
 #include "UIElements/Dialog.hpp"
 
+#include "atom.hpp"
+#include "element.hpp"
+#include "molecule.hpp"
 #include "vector.hpp"
 
@@ -51,6 +54,7 @@
 
 // Base class
-Dialog::Query::Query(string _title) :
-    title(_title)
+Dialog::Query::Query(string _title, string _description) :
+    title(_title),
+    description(_description)
 {}
 
@@ -61,8 +65,22 @@
 }
 
+const std::string Dialog::Query::getDescription() const{
+  return description;
+}
+// empty Queries
+
+Dialog::EmptyQuery::EmptyQuery(string title, std::string description) :
+    Query(title, description)
+{}
+
+Dialog::EmptyQuery::~EmptyQuery() {}
+
+void Dialog::EmptyQuery::setResult() {
+}
+
 // Int Queries
 
-Dialog::IntQuery::IntQuery(string title,int *_target) :
-    Query(title), target(_target)
+Dialog::IntQuery::IntQuery(string title,int *_target, std::string description) :
+    Query(title, description), target(_target)
 {}
 
@@ -73,8 +91,20 @@
 }
 
+// Int Queries
+
+Dialog::BooleanQuery::BooleanQuery(string title,bool *_target, std::string description) :
+    Query(title, description), target(_target)
+{}
+
+Dialog::BooleanQuery::~BooleanQuery() {}
+
+void Dialog::BooleanQuery::setResult() {
+  *target = tmp;
+}
+
 // String Queries
 
-Dialog::StringQuery::StringQuery(string title,string *_target) :
-    Query(title), target(_target)
+Dialog::StringQuery::StringQuery(string title,string *_target, std::string _description) :
+    Query(title, _description), target(_target)
 {}
 
@@ -87,6 +117,6 @@
 // Double Queries
 
-Dialog::DoubleQuery::DoubleQuery(string title,double *_target) :
-    Query(title), target(_target)
+Dialog::DoubleQuery::DoubleQuery(string title,double *_target, std::string _description) :
+    Query(title, _description), target(_target)
 {}
 
@@ -98,10 +128,24 @@
 
 
+// Atom Queries
+
+Dialog::AtomQuery::AtomQuery(string title, atom **_target, std::string _description) :
+    Query(title, _description),
+    tmp(0),
+    target(_target)
+
+{}
+
+Dialog::AtomQuery::~AtomQuery() {}
+
+void Dialog::AtomQuery::setResult() {
+  *target = tmp;
+}
+
 // Molecule Queries
 
-Dialog::MoleculeQuery::MoleculeQuery(string title, molecule **_target, MoleculeListClass *_molecules) :
-    Query(title),
+Dialog::MoleculeQuery::MoleculeQuery(string title, molecule **_target, std::string _description) :
+    Query(title, _description),
     tmp(0),
-    molecules(_molecules),
     target(_target)
 
@@ -116,6 +160,6 @@
 // Vector Queries
 
-Dialog::VectorQuery::VectorQuery(std::string title,Vector *_target,const double *const _cellSize,bool _check) :
-  Query(title),
+Dialog::VectorQuery::VectorQuery(std::string title,Vector *_target,const double *const _cellSize,bool _check, std::string _description) :
+  Query(title, _description),
   cellSize(_cellSize),
   check(_check),
@@ -134,7 +178,26 @@
 }
 
+// Box Queries
+
+Dialog::BoxQuery::BoxQuery(std::string title, double ** const _cellSize, std::string _description) :
+  Query(title, _description),
+  target(_cellSize)
+{
+    tmp = new double[6];
+}
+
+Dialog::BoxQuery::~BoxQuery()
+{
+  delete[] tmp;
+}
+
+void Dialog::BoxQuery::setResult() {
+  for (int i=0;i<6;i++)
+    *target[i] = tmp[i];
+}
+
 // Element Queries
-Dialog::ElementQuery::ElementQuery(std::string title, const element **_target) :
-  Query(title),
+Dialog::ElementQuery::ElementQuery(std::string title, const element **_target, std::string _description) :
+  Query(title, _description),
   tmp(0),
   target(_target)
Index: src/UIElements/Dialog.hpp
===================================================================
--- src/UIElements/Dialog.hpp	(revision 12872df33639e521d4b0225d6064ea91bd4f18e8)
+++ src/UIElements/Dialog.hpp	(revision f941b14c7a92d23575eccdfcd7bbb7ef127d1bad)
@@ -12,8 +12,8 @@
 #include<list>
 
-class MoleculeListClass;
+class atom;
+class element;
 class molecule;
 class Vector;
-class element;
 
 class Dialog
@@ -23,10 +23,14 @@
   virtual ~Dialog();
 
-  virtual void queryInt(const char *, int *)=0;
-  virtual void queryDouble(const char*,double *)=0;
-  virtual void queryString(const char*, std::string *)=0;
-  virtual void queryMolecule(const char*,molecule**,MoleculeListClass*)=0;
-  virtual void queryVector(const char*,Vector *,const double *const,bool)=0;
-  virtual void queryElement(const char*,const element **)=0;
+  virtual void queryEmpty(const char *, std::string = "")=0;
+  virtual void queryBoolean(const char *, bool *, std::string = "")=0;
+  virtual void queryInt(const char *, int *, std::string = "")=0;
+  virtual void queryDouble(const char*,double *, std::string = "")=0;
+  virtual void queryString(const char*, std::string *, std::string = "")=0;
+  virtual void queryAtom(const char*,atom**,std::string = "")=0;
+  virtual void queryMolecule(const char*,molecule**, std::string = "")=0;
+  virtual void queryVector(const char*,Vector *,const double *const,bool, std::string = "")=0;
+  virtual void queryBox(const char*,double ** const, std::string = "")=0;
+  virtual void queryElement(const char*,const element **, std::string = "")=0;
 
   virtual bool display();
@@ -46,5 +50,5 @@
   class Query {
   public:
-    Query(std::string _title);
+    Query(std::string _title, std::string _description = "");
     virtual ~Query();
     virtual bool handle()=0;
@@ -52,12 +56,35 @@
   protected:
     const std::string getTitle() const;
+    const std::string getDescription() const;
   private:
-    std::string title;
+    std::string title;  //!< short title of the query
+    std::string description; //!< longer description for tooltips or for help
+  };
+
+  // Empty Query is just meant for showing text, such as version, help, initial message or alike
+  class EmptyQuery : public Query {
+  public:
+    EmptyQuery(std::string title, std::string _description = "");
+    virtual ~EmptyQuery();
+    virtual bool handle()=0;
+    virtual void setResult();
   };
 
   //Specialized classes for certain types. GUI-Types are not specialized at this time
+  class BooleanQuery : public Query {
+  public:
+    BooleanQuery(std::string title,bool *_target, std::string _description = "");
+    virtual ~BooleanQuery();
+    virtual bool handle()=0;
+    virtual void setResult();
+  protected:
+    bool tmp;
+  private:
+    bool *target;
+  };
+
   class IntQuery : public Query {
   public:
-    IntQuery(std::string title,int *_target);
+    IntQuery(std::string title,int *_target, std::string _description = "");
     virtual ~IntQuery();
     virtual bool handle()=0;
@@ -71,5 +98,5 @@
   class DoubleQuery : public Query {
   public:
-    DoubleQuery(std::string title,double *_target);
+    DoubleQuery(std::string title,double *_target, std::string _description = "");
     virtual ~DoubleQuery();
     virtual bool handle()=0;
@@ -83,5 +110,5 @@
   class StringQuery : public Query {
   public:
-    StringQuery(std::string title,std::string *_target);
+    StringQuery(std::string title,std::string *_target, std::string _description = "");
     virtual ~StringQuery();
     virtual bool handle()=0;
@@ -93,8 +120,7 @@
   };
 
-
   class MoleculeQuery : public Query {
   public:
-    MoleculeQuery(std::string title, molecule **_target, MoleculeListClass *_molecules);
+    MoleculeQuery(std::string title, molecule **_target, std::string _description = "");
     virtual ~MoleculeQuery();
     virtual bool handle()=0;
@@ -102,12 +128,23 @@
   protected:
     molecule *tmp;
-    MoleculeListClass *molecules;
   private:
     molecule **target;
   };
 
+  class AtomQuery : public Query {
+  public:
+    AtomQuery(std::string title, atom **_target, std::string _description = "");
+    virtual ~AtomQuery();
+    virtual bool handle()=0;
+    virtual void setResult();
+  protected:
+    atom *tmp;
+  private:
+    atom **target;
+  };
+
   class VectorQuery : public Query {
   public:
-      VectorQuery(std::string title,Vector *_target,const double *const _cellSize,bool _check);
+      VectorQuery(std::string title,Vector *_target,const double *const _cellSize,bool _check, std::string _description = "");
       virtual ~VectorQuery();
       virtual bool handle()=0;
@@ -121,7 +158,19 @@
   };
 
+  class BoxQuery : public Query {
+  public:
+      BoxQuery(std::string title,double ** const _cellSize, std::string _description = "");
+      virtual ~BoxQuery();
+      virtual bool handle()=0;
+      virtual void setResult();
+    protected:
+      double *tmp;
+    private:
+      double **target;
+  };
+
   class ElementQuery : public Query {
   public:
-    ElementQuery(std::string title, const element**_target);
+    ElementQuery(std::string title, const element**_target, std::string _description = "");
     virtual ~ElementQuery();
     virtual bool handle()=0;
@@ -140,3 +189,4 @@
 };
 
+
 #endif /* DIALOG_HPP_ */
Index: src/UIElements/MainWindow.hpp
===================================================================
--- src/UIElements/MainWindow.hpp	(revision 12872df33639e521d4b0225d6064ea91bd4f18e8)
+++ src/UIElements/MainWindow.hpp	(revision f941b14c7a92d23575eccdfcd7bbb7ef127d1bad)
@@ -25,19 +25,4 @@
 };
 
-/**
- * The type of menuPopulators
- */
-typedef void (*MenuMaker)(Menu*,MoleculeListClass*, config*, periodentafel*);
-
-/**
- * This contains all Functions that are used to create the menus.
- * Needs a specific funtion for each menu. All populators will be called
- * by the UIFactory upon creation of the main menu. Thus the actuall construction
- * of the Menus can be kept independent of the concrete type of UI that is being
- * built.
- */
-struct menuPopulaters{
-  MenuMaker MakeEditMoleculesMenu;
-};
 
 #endif /* MAINWINDOW_HPP_ */
Index: src/UIElements/TextDialog.cpp
===================================================================
--- src/UIElements/TextDialog.cpp	(revision 12872df33639e521d4b0225d6064ea91bd4f18e8)
+++ src/UIElements/TextDialog.cpp	(revision f941b14c7a92d23575eccdfcd7bbb7ef127d1bad)
@@ -8,13 +8,20 @@
 #include <iostream>
 
+#include <Descriptors/AtomDescriptor.hpp>
+#include <Descriptors/AtomIdDescriptor.hpp>
+#include <Descriptors/MoleculeDescriptor.hpp>
+#include <Descriptors/MoleculeIdDescriptor.hpp>
 #include "UIElements/TextDialog.hpp"
 
 #include "World.hpp"
 #include "periodentafel.hpp"
-#include "atom.hpp"
-#include "molecule.hpp"
 #include "log.hpp"
 #include "verbose.hpp"
 
+#include "atom.hpp"
+#include "element.hpp"
+#include "molecule.hpp"
+#include "vector.hpp"
+
 using namespace std;
 
@@ -29,32 +36,59 @@
 
 
-void TextDialog::queryInt(const char* title, int* target){
-  registerQuery(new IntTextQuery(title,target));
-}
-
-void TextDialog::queryDouble(const char* title, double* target){
-  registerQuery(new DoubleTextQuery(title,target));
-}
-
-void TextDialog::queryString(const char* title, string* target){
-  registerQuery(new StringTextQuery(title,target));
-}
-
-void TextDialog::queryMolecule(const char* title, molecule **target, MoleculeListClass *molecules) {
-  registerQuery(new MoleculeTextQuery(title,target,molecules));
-}
-
-void TextDialog::queryVector(const char* title, Vector *target,const double *const cellSize, bool check) {
-  registerQuery(new VectorTextQuery(title,target,cellSize,check));
-}
-
-void TextDialog::queryElement(const char* title, const element **target){
-  registerQuery(new ElementTextQuery(title,target));
+void TextDialog::queryEmpty(const char* title, string description){
+  registerQuery(new EmptyTextQuery(title,description));
+}
+
+void TextDialog::queryBoolean(const char* title, bool* target, string description){
+  registerQuery(new BooleanTextQuery(title,target,description));
+}
+
+void TextDialog::queryInt(const char* title, int* target, string description){
+  registerQuery(new IntTextQuery(title,target,description));
+}
+
+void TextDialog::queryDouble(const char* title, double* target, string description){
+  registerQuery(new DoubleTextQuery(title,target,description));
+}
+
+void TextDialog::queryString(const char* title, string* target, string description){
+  registerQuery(new StringTextQuery(title,target,description));
+}
+
+void TextDialog::queryAtom(const char* title, atom **target, string description) {
+  registerQuery(new AtomTextQuery(title,target,description));
+}
+
+void TextDialog::queryMolecule(const char* title, molecule **target, string description) {
+  registerQuery(new MoleculeTextQuery(title,target,description));
+}
+
+void TextDialog::queryVector(const char* title, Vector *target,const double *const cellSize, bool check, string description) {
+  registerQuery(new VectorTextQuery(title,target,cellSize,check,description));
+}
+
+void TextDialog::queryBox(const char* title,double ** const cellSize, string description) {
+  registerQuery(new BoxTextQuery(title,cellSize,description));
+}
+
+void TextDialog::queryElement(const char* title, const element **target, string description){
+  registerQuery(new ElementTextQuery(title,target,description));
 }
 
 /************************** Query Infrastructure ************************/
 
-TextDialog::IntTextQuery::IntTextQuery(string title,int *_target) :
-    Dialog::IntQuery(title,_target)
+TextDialog::EmptyTextQuery::EmptyTextQuery(string title, std::string _description) :
+    Dialog::EmptyQuery(title,_description)
+{}
+
+TextDialog::EmptyTextQuery::~EmptyTextQuery() {}
+
+bool TextDialog::EmptyTextQuery::handle() {
+  cout << "Message of " << getTitle() << ":\n" << getDescription() << "\n";
+  return true;
+}
+
+TextDialog::IntTextQuery::IntTextQuery(string title, int * _target, std::string _description) :
+    Dialog::IntQuery(title,_target,_description)
 {}
 
@@ -79,6 +113,35 @@
 }
 
-TextDialog::StringTextQuery::StringTextQuery(string title,string *_target) :
-    Dialog::StringQuery(title,_target)
+TextDialog::BooleanTextQuery::BooleanTextQuery(string title, bool * _target, std::string _description) :
+    Dialog::BooleanQuery(title,_target,_description)
+{}
+
+TextDialog::BooleanTextQuery::~BooleanTextQuery() {}
+
+bool TextDialog::BooleanTextQuery::handle() {
+  bool badInput = false;
+  char input = ' ';
+  do{
+    badInput = false;
+    Log() << Verbose(0) << getTitle();
+    cin >> input;
+    if ((input == 'y' ) || (input == 'Y')) {
+      tmp = true;
+    } else if ((input == 'n' ) || (input == 'N')) {
+      tmp = false;
+    } else {
+      badInput=true;
+      cin.clear();
+      cin.ignore(std::numeric_limits<streamsize>::max(),'\n');
+      Log() << Verbose(0) << "Input was not of [yYnN]!" << endl;
+    }
+  } while(badInput);
+  // clear the input buffer of anything still in the line
+  cin.ignore(std::numeric_limits<streamsize>::max(),'\n');
+  return true;
+}
+
+TextDialog::StringTextQuery::StringTextQuery(string title,string *_target, std::string _description) :
+    Dialog::StringQuery(title,_target,_description)
 {}
 
@@ -91,6 +154,6 @@
 }
 
-TextDialog::DoubleTextQuery::DoubleTextQuery(string title,double *_target) :
-    Dialog::DoubleQuery(title,_target)
+TextDialog::DoubleTextQuery::DoubleTextQuery(string title,double *_target, std::string _description) :
+    Dialog::DoubleQuery(title,_target,_description)
 {}
 
@@ -114,6 +177,38 @@
 }
 
-TextDialog::MoleculeTextQuery::MoleculeTextQuery(string title, molecule **_target, MoleculeListClass *_molecules) :
-    Dialog::MoleculeQuery(title,_target,_molecules)
+TextDialog::AtomTextQuery::AtomTextQuery(string title, atom **_target, std::string _description) :
+    Dialog::AtomQuery(title,_target,_description)
+{}
+
+TextDialog::AtomTextQuery::~AtomTextQuery() {}
+
+bool TextDialog::AtomTextQuery::handle() {
+  int idxOfAtom=0;
+  bool badInput = false;
+  do{
+    badInput = false;
+    Log() << Verbose(0) << getTitle();
+    cin >> idxOfAtom;
+    if(cin.fail()){
+      badInput = true;
+      cin.clear();
+      cin.ignore(std::numeric_limits<streamsize>::max(),'\n');
+      Log() << Verbose(0) << "Input was not a number!" << endl;
+      continue;
+    }
+
+    tmp = World::getInstance().getAtom(AtomById(idxOfAtom));
+    if(!tmp && idxOfAtom!=-1){
+      Log() << Verbose(0) << "Invalid Atom Index" << endl;
+      badInput = true;
+    }
+
+  } while(badInput);
+  cin.ignore(std::numeric_limits<streamsize>::max(),'\n');
+  return (idxOfAtom!=-1);
+}
+
+TextDialog::MoleculeTextQuery::MoleculeTextQuery(string title, molecule **_target, std::string _description) :
+    Dialog::MoleculeQuery(title,_target,_description)
 {}
 
@@ -135,5 +230,5 @@
     }
 
-    tmp = molecules->ReturnIndex(idxOfMol);
+    tmp = World::getInstance().getMolecule(MoleculeById(idxOfMol));
     if(!tmp && idxOfMol!=-1){
       Log() << Verbose(0) << "Invalid Molecule Index" << endl;
@@ -146,6 +241,6 @@
 }
 
-TextDialog::VectorTextQuery::VectorTextQuery(std::string title, Vector *_target, const double *const _cellSize, bool _check) :
-    Dialog::VectorQuery(title,_target,_cellSize,_check)
+TextDialog::VectorTextQuery::VectorTextQuery(std::string title, Vector *_target, const double *const _cellSize, bool _check, std::string _description) :
+    Dialog::VectorQuery(title,_target,_cellSize,_check,_description)
 {}
 
@@ -168,7 +263,24 @@
 }
 
-
-TextDialog::ElementTextQuery::ElementTextQuery(std::string title, const element **target) :
-    Dialog::ElementQuery(title,target)
+TextDialog::BoxTextQuery::BoxTextQuery(std::string title, double ** const _cellSize, std::string _description) :
+    Dialog::BoxQuery(title,_cellSize,_description)
+{}
+
+TextDialog::BoxTextQuery::~BoxTextQuery()
+{}
+
+bool TextDialog::BoxTextQuery::handle() {
+  Log() << Verbose(0) << getTitle();
+
+  std::string coords[6] = {"xx","xy","xz", "yy", "yz", "zz"};
+  for (int i=0;i<6;i++) {
+    Log() << Verbose(0) << coords[i] << ": ";
+    cin >> tmp[i];
+  }
+  return true;
+}
+
+TextDialog::ElementTextQuery::ElementTextQuery(std::string title, const element **target, std::string _description) :
+    Dialog::ElementQuery(title,target,_description)
 {}
 
Index: src/UIElements/TextDialog.hpp
===================================================================
--- src/UIElements/TextDialog.hpp	(revision 12872df33639e521d4b0225d6064ea91bd4f18e8)
+++ src/UIElements/TextDialog.hpp	(revision f941b14c7a92d23575eccdfcd7bbb7ef127d1bad)
@@ -13,4 +13,9 @@
 #include "UIElements/Dialog.hpp"
 
+class atom;
+class element;
+class molecule;
+class Vector;
+
 class TextDialog : public Dialog
 {
@@ -19,16 +24,34 @@
   virtual ~TextDialog();
 
-  virtual void queryInt(const char *, int *);
-  virtual void queryString(const char*, std::string *);
-  virtual void queryDouble(const char*, double*);
-  virtual void queryMolecule(const char*,molecule**,MoleculeListClass*);
-  virtual void queryVector(const char*,Vector *,const double * const,bool);
-  virtual void queryElement(const char*,const element **);
+  virtual void queryEmpty(const char *, std::string = "");
+  virtual void queryBoolean(const char *, bool *, std::string = "");
+  virtual void queryInt(const char *, int *, std::string = "");
+  virtual void queryString(const char*, std::string *, std::string = "");
+  virtual void queryDouble(const char*, double*, std::string = "");
+  virtual void queryAtom(const char*,atom**,std::string = "");
+  virtual void queryMolecule(const char*,molecule**,std::string = "");
+  virtual void queryVector(const char*,Vector *,const double * const,bool, std::string = "");
+  virtual void queryBox(const char*,double ** const, std::string = "");
+  virtual void queryElement(const char*,const element **, std::string = "");
 
 protected:
   // specialized stuff for text queries
+  class EmptyTextQuery : public Dialog::EmptyQuery {
+  public:
+    EmptyTextQuery(std::string title, std::string _description = NULL);
+    virtual ~EmptyTextQuery();
+    virtual bool handle();
+  };
+
+  class BooleanTextQuery : public Dialog::BooleanQuery {
+  public:
+    BooleanTextQuery(std::string title, bool *_target, std::string _description = NULL);
+    virtual ~BooleanTextQuery();
+    virtual bool handle();
+  };
+
   class IntTextQuery : public Dialog::IntQuery {
   public:
-    IntTextQuery(std::string title, int *_target);
+    IntTextQuery(std::string title, int *_target, std::string _description = NULL);
     virtual ~IntTextQuery();
     virtual bool handle();
@@ -37,5 +60,5 @@
   class DoubleTextQuery : public Dialog::DoubleQuery {
   public:
-    DoubleTextQuery(std::string title, double *_target);
+    DoubleTextQuery(std::string title, double *_target, std::string _description = NULL);
     virtual ~DoubleTextQuery();
     virtual bool handle();
@@ -44,6 +67,13 @@
   class StringTextQuery : public Dialog::StringQuery {
   public:
-    StringTextQuery(std::string title, std::string *_target);
+    StringTextQuery(std::string title, std::string *_target, std::string _description = NULL);
     virtual ~StringTextQuery();
+    virtual bool handle();
+  };
+
+  class AtomTextQuery : public Dialog::AtomQuery {
+  public:
+    AtomTextQuery(std::string title, atom **_target, std::string _description = NULL);
+    virtual ~AtomTextQuery();
     virtual bool handle();
   };
@@ -51,5 +81,5 @@
   class MoleculeTextQuery : public Dialog::MoleculeQuery {
   public:
-    MoleculeTextQuery(std::string title, molecule **_target, MoleculeListClass *_molecules);
+    MoleculeTextQuery(std::string title, molecule **_target, std::string _description = NULL);
     virtual ~MoleculeTextQuery();
     virtual bool handle();
@@ -58,6 +88,13 @@
   class VectorTextQuery : public Dialog::VectorQuery {
   public:
-    VectorTextQuery(std::string title,Vector *_target,const double *const _cellSize,bool _check);
+    VectorTextQuery(std::string title,Vector *_target,const double *const _cellSize,bool _check, std::string _description = NULL);
     virtual ~VectorTextQuery();
+    virtual bool handle();
+  };
+
+  class BoxTextQuery : public Dialog::BoxQuery {
+  public:
+    BoxTextQuery(std::string title,double ** const _cellSize, std::string _description = NULL);
+    virtual ~BoxTextQuery();
     virtual bool handle();
   };
@@ -65,5 +102,5 @@
   class ElementTextQuery : public Dialog::ElementQuery {
   public:
-    ElementTextQuery(std::string title, const element **_target);
+    ElementTextQuery(std::string title, const element **_target, std::string _description = NULL);
     virtual ~ElementTextQuery();
     virtual bool handle();
Index: src/UIElements/TextUIFactory.cpp
===================================================================
--- src/UIElements/TextUIFactory.cpp	(revision 12872df33639e521d4b0225d6064ea91bd4f18e8)
+++ src/UIElements/TextUIFactory.cpp	(revision f941b14c7a92d23575eccdfcd7bbb7ef127d1bad)
@@ -27,6 +27,6 @@
 }
 
-MainWindow* TextUIFactory::makeMainWindow(menuPopulaters populaters,MoleculeListClass *molecules, config *configuration, periodentafel *periode, char *ConfigFileName) {
-  return new TextWindow(populaters,molecules,configuration,periode,ConfigFileName);
+MainWindow* TextUIFactory::makeMainWindow() {
+  return new TextWindow();
 }
 
Index: src/UIElements/TextUIFactory.hpp
===================================================================
--- src/UIElements/TextUIFactory.hpp	(revision 12872df33639e521d4b0225d6064ea91bd4f18e8)
+++ src/UIElements/TextUIFactory.hpp	(revision f941b14c7a92d23575eccdfcd7bbb7ef127d1bad)
@@ -19,5 +19,5 @@
 
   virtual Dialog* makeDialog();
-  virtual MainWindow* makeMainWindow(menuPopulaters,MoleculeListClass *, config *, periodentafel *, char *);
+  virtual MainWindow* makeMainWindow();
 
 protected:
Index: src/UIElements/TextWindow.cpp
===================================================================
--- src/UIElements/TextWindow.cpp	(revision 12872df33639e521d4b0225d6064ea91bd4f18e8)
+++ src/UIElements/TextWindow.cpp	(revision f941b14c7a92d23575eccdfcd7bbb7ef127d1bad)
@@ -27,4 +27,5 @@
 #include "molecule.hpp"
 #include "periodentafel.hpp"
+#include "World.hpp"
 
 #include "Legacy/oldmenu.hpp"
@@ -38,4 +39,5 @@
 #include "UIElements/TextStatusIndicator.hpp"
 #include "Actions/MethodAction.hpp"
+#include "Actions/MoleculeAction/ChangeNameAction.hpp"
 #include "Actions/ErrorAction.hpp"
 #include "Actions/ActionRegistry.hpp"
@@ -48,6 +50,10 @@
 
 // TODO: see what code can be moved to a base class for Graphic and Text Windows
-TextWindow::TextWindow(menuPopulaters populaters,MoleculeListClass *molecules, config *configuration, periodentafel *periode, char *ConfigFileName)
+TextWindow::TextWindow()
 {
+  MoleculeListClass *molecules = World::getInstance().getMolecules();
+  config *configuration = World::getInstance().getConfig();
+  periodentafel *periode = World::getInstance().getPeriode();
+  char *ConfigFileName = NULL;
   old_menu = new oldmenu;
 
@@ -101,5 +107,5 @@
   // call all functions used to build the submenus
 
-  populaters.MakeEditMoleculesMenu(editMoleculesMenu,molecules,configuration,periode);
+  populateEditMoleculesMenu(editMoleculesMenu);
 
   Action *returnFromEditMoleculeAction = new TextMenu::LeaveAction(editMoleculesMenu);
@@ -125,2 +131,28 @@
   main_menu->display();
 }
+
+void TextWindow::populateEditMoleculesMenu(Menu* editMoleculesMenu)
+{
+  MoleculeListClass *molecules = World::getInstance().getMolecules();
+  periodentafel *periode = World::getInstance().getPeriode();
+
+  // build the EditMoleculesMenu
+  Action *createMoleculeAction = new MethodAction("createMoleculeAction",boost::bind(&MoleculeListClass::createNewMolecule,molecules,periode));
+  new ActionMenuItem('c',"create new molecule",editMoleculesMenu,createMoleculeAction);
+
+  Action *loadMoleculeAction = new MethodAction("loadMoleculeAction",boost::bind(&MoleculeListClass::loadFromXYZ,molecules,periode));
+  new ActionMenuItem('l',"load molecule from xyz file",editMoleculesMenu,loadMoleculeAction);
+
+  Action *changeFilenameAction = new MoleculeChangeNameAction();
+  new ActionMenuItem('n',"change molecule's name",editMoleculesMenu,changeFilenameAction);
+
+  Action *giveFilenameAction = new MethodAction("giveFilenameAction",boost::bind(&MoleculeListClass::setMoleculeFilename,molecules));
+  new ActionMenuItem('N',"give molecules filename",editMoleculesMenu,giveFilenameAction);
+
+  Action *parseAtomsAction = new MethodAction("parseAtomsAction",boost::bind(&MoleculeListClass::parseXYZIntoMolecule,molecules));
+  new ActionMenuItem('p',"parse atoms in xyz file into molecule",editMoleculesMenu,parseAtomsAction);
+
+  Action *eraseMoleculeAction = new MethodAction("eraseMoleculeAction",boost::bind(&MoleculeListClass::eraseMolecule,molecules));
+  new ActionMenuItem('r',"remove a molecule",editMoleculesMenu,eraseMoleculeAction);
+
+}
Index: src/UIElements/TextWindow.hpp
===================================================================
--- src/UIElements/TextWindow.hpp	(revision 12872df33639e521d4b0225d6064ea91bd4f18e8)
+++ src/UIElements/TextWindow.hpp	(revision f941b14c7a92d23575eccdfcd7bbb7ef127d1bad)
@@ -17,12 +17,16 @@
 class TextStatusIndicator;
 
+
 class TextWindow : public MainWindow
 {
 public:
-  TextWindow(menuPopulaters,MoleculeListClass *, config *, periodentafel *, char *);
+  TextWindow();
   virtual ~TextWindow();
 
   virtual void display();
 private:
+  // populaters
+  void populateEditMoleculesMenu(Menu* editMoleculesMenu);
+
   TextMenu *main_menu;
 
Index: src/UIElements/UIFactory.cpp
===================================================================
--- src/UIElements/UIFactory.cpp	(revision 12872df33639e521d4b0225d6064ea91bd4f18e8)
+++ src/UIElements/UIFactory.cpp	(revision f941b14c7a92d23575eccdfcd7bbb7ef127d1bad)
@@ -13,4 +13,5 @@
 // all factories that can be used:
 #include "UIElements/TextUIFactory.hpp"
+#include "UIElements/CommandLineUIFactory.hpp"
 
 UIFactory::UIFactory()
@@ -30,4 +31,7 @@
       setInstance(new TextUIFactory());
       break;
+    case CommandLine:
+      setInstance(new CommandLineUIFactory());
+      break;
 
     default:
Index: src/UIElements/UIFactory.hpp
===================================================================
--- src/UIElements/UIFactory.hpp	(revision 12872df33639e521d4b0225d6064ea91bd4f18e8)
+++ src/UIElements/UIFactory.hpp	(revision f941b14c7a92d23575eccdfcd7bbb7ef127d1bad)
@@ -11,10 +11,5 @@
 class MainWindow;
 class Dialog;
-
-class MoleculeListClass;
-class config;
-class periodentafel;
-
-struct menuPopulaters;
+class DialogDescription;
 
 #include "Patterns/Singleton.hpp"
@@ -31,5 +26,5 @@
 
 public:
-  enum InterfaceTypes {Text};
+  enum InterfaceTypes {Text, CommandLine};
   virtual ~UIFactory();
 
@@ -37,5 +32,5 @@
    * Produce some kind of main window, of whichever type was chosen when the factory was created
    */
-  virtual MainWindow* makeMainWindow(menuPopulaters,MoleculeListClass *, config *, periodentafel *, char *)=0;
+  virtual MainWindow* makeMainWindow()=0;
 
   /**
Index: src/World.cpp
===================================================================
--- src/World.cpp	(revision 12872df33639e521d4b0225d6064ea91bd4f18e8)
+++ src/World.cpp	(revision f941b14c7a92d23575eccdfcd7bbb7ef127d1bad)
@@ -9,4 +9,5 @@
 
 #include "atom.hpp"
+#include "config.hpp"
 #include "molecule.hpp"
 #include "periodentafel.hpp"
@@ -27,4 +28,8 @@
 }
 
+config *&World::getConfig(){
+  return configuration;
+}
+
 // Atoms
 
@@ -53,4 +58,8 @@
 std::vector<molecule*> World::getAllMolecules(MoleculeDescriptor descriptor){
   return descriptor.findAll();
+}
+
+std::vector<molecule*> World::getAllMolecules(){
+  return getAllMolecules(AllMolecules());
 }
 
@@ -267,4 +276,5 @@
 World::World() :
     periode(new periodentafel),
+    configuration(new config),
     atoms(),
     currAtomId(0),
@@ -292,4 +302,5 @@
   delete molecules_deprecated;
   delete periode;
+  delete configuration;
   MoleculeSet::iterator molIter;
   for(molIter=molecules.begin();molIter!=molecules.end();++molIter){
Index: src/World.hpp
===================================================================
--- src/World.hpp	(revision 12872df33639e521d4b0225d6064ea91bd4f18e8)
+++ src/World.hpp	(revision f941b14c7a92d23575eccdfcd7bbb7ef127d1bad)
@@ -30,4 +30,5 @@
 
 // forward declarations
+class config;
 class periodentafel;
 class MoleculeListClass;
@@ -75,4 +76,9 @@
 
   /**
+   * returns the configuration for the world.
+   */
+  config *&getConfig();
+
+  /**
    * returns the first atom that matches a given descriptor.
    * Do not rely on ordering for descriptors that match more than one atom.
@@ -109,4 +115,5 @@
    */
   std::vector<molecule*> getAllMolecules(MoleculeDescriptor descriptor);
+  std::vector<molecule*> getAllMolecules();
 
   /**
@@ -234,4 +241,5 @@
 
   periodentafel *periode;
+  config *configuration;
   static double *cell_size;
   static char *defaultName;
Index: src/atom_bondedparticle.cpp
===================================================================
--- src/atom_bondedparticle.cpp	(revision 12872df33639e521d4b0225d6064ea91bd4f18e8)
+++ src/atom_bondedparticle.cpp	(revision f941b14c7a92d23575eccdfcd7bbb7ef127d1bad)
@@ -74,4 +74,20 @@
       *BondFile << nr << "\t" << (*Runner)->GetOtherAtom(this)->nr << "\n";
 };
+
+/**
+ * Adds a bond between this bonded particle and another. Does nothing if this
+ * bond already exists.
+ *
+ * \param bonding partner
+ */
+void BondedParticle::addBond(BondedParticle* Partner) {
+  if (IsBondedTo(Partner)) {
+    return;
+  }
+
+  bond* newBond = new bond((atom*) this, (atom*) Partner, 1, 0);
+  RegisterBond(newBond);
+  Partner->RegisterBond(newBond);
+}
 
 /** Puts a given bond into atom::ListOfBonds.
Index: src/atom_bondedparticle.hpp
===================================================================
--- src/atom_bondedparticle.hpp	(revision 12872df33639e521d4b0225d6064ea91bd4f18e8)
+++ src/atom_bondedparticle.hpp	(revision f941b14c7a92d23575eccdfcd7bbb7ef127d1bad)
@@ -37,4 +37,5 @@
   virtual ~BondedParticle();
 
+  void addBond(BondedParticle* Partner);
   bool RegisterBond(bond *Binder);
   bool UnregisterBond(bond *Binder);
Index: src/atom_particleinfo.cpp
===================================================================
--- src/atom_particleinfo.cpp	(revision 12872df33639e521d4b0225d6064ea91bd4f18e8)
+++ src/atom_particleinfo.cpp	(revision f941b14c7a92d23575eccdfcd7bbb7ef127d1bad)
@@ -16,5 +16,8 @@
     nr(pointer->nr),
     Name(pointer->Name)
-    {}
+    {
+      if (Name == NULL)
+        Name = " ";
+    }
 
 
Index: src/bond.cpp
===================================================================
--- src/bond.cpp	(revision 12872df33639e521d4b0225d6064ea91bd4f18e8)
+++ src/bond.cpp	(revision f941b14c7a92d23575eccdfcd7bbb7ef127d1bad)
@@ -15,5 +15,7 @@
 /** Empty Constructor for class bond.
  */
-bond::bond() : leftatom(NULL), rightatom(NULL), previous(NULL), next(NULL), HydrogenBond(0), BondDegree(0), nr(-1), Cyclic(false), Type(Undetermined), Used(white)
+bond::bond()
+  : leftatom(NULL), rightatom(NULL), previous(NULL), next(NULL), HydrogenBond(0),
+    BondDegree(0), nr(-1), Cyclic(false), Type(Undetermined), Used(white)
 {
 };
@@ -25,5 +27,7 @@
  * \param number increasing index
  */
-bond::bond(atom *left, atom *right, const int degree, const int number) : leftatom(left), rightatom(right), previous(NULL), next(NULL), HydrogenBond(0), BondDegree(degree), nr(number), Cyclic(false), Type(Undetermined), Used(white)
+bond::bond(atom *left, atom *right, const int degree, const int number)
+  : leftatom(left), rightatom(right), previous(NULL), next(NULL), HydrogenBond(0),
+    BondDegree(degree), nr(number), Cyclic(false), Type(Undetermined), Used(white)
 {
   if ((left != NULL) && (right != NULL)) {
Index: src/bondgraph.hpp
===================================================================
--- src/bondgraph.hpp	(revision 12872df33639e521d4b0225d6064ea91bd4f18e8)
+++ src/bondgraph.hpp	(revision f941b14c7a92d23575eccdfcd7bbb7ef127d1bad)
@@ -27,5 +27,5 @@
 
 class molecule;
-class periodentafel;
+class BondedParticle;
 class MatrixContainer;
 
Index: src/builder.cpp
===================================================================
--- src/builder.cpp	(revision 12872df33639e521d4b0225d6064ea91bd4f18e8)
+++ src/builder.cpp	(revision f941b14c7a92d23575eccdfcd7bbb7ef127d1bad)
@@ -60,4 +60,5 @@
 #include "bondgraph.hpp"
 #include "boundary.hpp"
+#include "CommandLineParser.hpp"
 #include "config.hpp"
 #include "element.hpp"
@@ -76,6 +77,7 @@
 #include "Actions/ActionRegistry.hpp"
 #include "Actions/ActionHistory.hpp"
+#include "Actions/MapOfActions.hpp"
 #include "Actions/MethodAction.hpp"
-#include "Actions/small_actions.hpp"
+#include "Actions/MoleculeAction/ChangeNameAction.hpp"
 #include "World.hpp"
 #include "version.h"
@@ -1479,4 +1481,6 @@
 
 /** Parses the command line options.
+ * Note that this function is from now on transitional. All commands that are not passed
+ * here are handled by CommandLineParser and the actions of CommandLineUIFactory.
  * \param argc argument count
  * \param **argv arguments array
@@ -1486,8 +1490,9 @@
  * \param *ConfigFileName pointer to config file name in **argv
  * \param *PathToDatabases pointer to db's path in **argv
+ * \param &ArgcList list of arguments that we do not parse here
  * \return exit code (0 - successful, all else - something's wrong)
  */
-static int ParseCommandLineOptions(int argc, char **argv, MoleculeListClass *&molecules, periodentafel *&periode,\
-                                   config& configuration, char *&ConfigFileName)
+static int ParseCommandLineOptions(int argc, char **argv, MoleculeListClass *&molecules, periodentafel *&periode,
+                                   config& configuration, char *&ConfigFileName, list<int> &ArgcList)
 {
   Vector x,y,z,n;  // coordinates for absolute point in cell volume
@@ -1507,5 +1512,4 @@
   molecule *mol = NULL;
   string BondGraphFileName("\n");
-  int verbosity = 0;
   strncpy(configuration.databasepath, LocalPath, MAXSTRINGSIZE-1);
 
@@ -1521,58 +1525,15 @@
           case 'H':
           case '?':
-            DoLog(0) && (Log() << Verbose(0) << "MoleCuilder suite" << endl << "==================" << endl << endl);
-            DoLog(0) && (Log() << Verbose(0) << "Usage: " << argv[0] << "[config file] [-{acefpsthH?vfrp}] [further arguments]" << endl);
-            DoLog(0) && (Log() << Verbose(0) << "or simply " << argv[0] << " without arguments for interactive session." << endl);
-            DoLog(0) && (Log() << Verbose(0) << "\t-a Z x1 x2 x3\tAdd new atom of element Z at coordinates (x1,x2,x3)." << endl);
-            DoLog(0) && (Log() << Verbose(0) << "\t-A <source>\tCreate adjacency list from bonds parsed from 'dbond'-style file." <<endl);
-            DoLog(0) && (Log() << Verbose(0) << "\t-b xx xy xz yy yz zz\tCenter atoms in domain with given symmetric matrix of (xx,xy,xz,yy,yz,zz)." << endl);
-            DoLog(0) && (Log() << Verbose(0) << "\t-B xx xy xz yy yz zz\tBound atoms by domain with given symmetric matrix of (xx,xy,xz,yy,yz,zz)." << endl);
-            DoLog(0) && (Log() << Verbose(0) << "\t-c x1 x2 x3\tCenter atoms in domain with a minimum distance to boundary of (x1,x2,x3)." << endl);
-            DoLog(0) && (Log() << Verbose(0) << "\t-C <type> [params] <output> <bin output> <BinWidth> <BinStart> <BinEnd>\tPair Correlation analysis." << endl);
-            DoLog(0) && (Log() << Verbose(0) << "\t-d x1 x2 x3\tDuplicate cell along each axis by given factor." << endl);
-            DoLog(0) && (Log() << Verbose(0) << "\t-D <bond distance>\tDepth-First-Search Analysis of the molecule, giving cycles and tree/back edges." << endl);
-            DoLog(0) && (Log() << Verbose(0) << "\t-e <file>\tSets the databases path to be parsed (default: ./)." << endl);
-            DoLog(0) && (Log() << Verbose(0) << "\t-E <id> <Z>\tChange atom <id>'s element to <Z>, <id> begins at 0." << endl);
-            DoLog(0) && (Log() << Verbose(0) << "\t-f <dist> <order>\tFragments the molecule in BOSSANOVA manner (with/out rings compressed) and stores config files in same dir as config (return code 0 - fragmented, 2 - no fragmentation necessary)." << endl);
-            DoLog(0) && (Log() << Verbose(0) << "\t-F <xyz of filler> <dist_x> <dist_y> <dist_z> <epsilon> <randatom> <randmol> <DoRotate>\tFilling Box with water molecules." << endl);
-            DoLog(0) && (Log() << Verbose(0) << "\t-FF <MaxDistance> <xyz of filler> <dist_x> <dist_y> <dist_z> <epsilon> <randatom> <randmol> <DoRotate>\tFilling Box with water molecules." << endl);
-            DoLog(0) && (Log() << Verbose(0) << "\t-g <file>\tParses a bond length table from the given file." << endl);
-            DoLog(0) && (Log() << Verbose(0) << "\t-h/-H/-?\tGive this help screen." << endl);
-            DoLog(0) && (Log() << Verbose(0) << "\t-I\t Dissect current system of molecules into a set of disconnected (subgraphs of) molecules." << endl);
-            DoLog(0) && (Log() << Verbose(0) << "\t-j\t<path> Store all bonds to file." << endl);
-            DoLog(0) && (Log() << Verbose(0) << "\t-J\t<path> Store adjacency per atom to file." << endl);
-            DoLog(0) && (Log() << Verbose(0) << "\t-L <step0> <step1> <prefix>\tStore a linear interpolation between two configurations <step0> and <step1> into single config files with prefix <prefix> and as Trajectories into the current config file." << endl);
-            DoLog(0) && (Log() << Verbose(0) << "\t-m <0/1>\tCalculate (0)/ Align in(1) PAS with greatest EV along z axis." << endl);
-            DoLog(0) && (Log() << Verbose(0) << "\t-M <basis>\tSetting basis to store to MPQC config files." << endl);
-            DoLog(0) && (Log() << Verbose(0) << "\t-n\tFast parsing (i.e. no trajectories are looked for)." << endl);
-            DoLog(0) && (Log() << Verbose(0) << "\t-N <radius> <file>\tGet non-convex-envelope." << endl);
-            DoLog(0) && (Log() << Verbose(0) << "\t-o <out>\tGet volume of the convex envelope (and store to tecplot file)." << endl);
-            DoLog(0) && (Log() << Verbose(0) << "\t-O\tCenter atoms in origin." << endl);
-            DoLog(0) && (Log() << Verbose(0) << "\t-p <file>\tParse given xyz file and create raw config file from it." << endl);
-            DoLog(0) && (Log() << Verbose(0) << "\t-P <file>\tParse given forces file and append as an MD step to config file via Verlet." << endl);
-            DoLog(0) && (Log() << Verbose(0) << "\t-r <id>\t\tRemove an atom with given id." << endl);
-            DoLog(0) && (Log() << Verbose(0) << "\t-R <id> <radius>\t\tRemove all atoms out of sphere around a given one." << endl);
-            DoLog(0) && (Log() << Verbose(0) << "\t-s x1 x2 x3\tScale all atom coordinates by this vector (x1,x2,x3)." << endl);
-            DoLog(0) && (Log() << Verbose(0) << "\t-S <file> Store temperatures from the config file in <file>." << endl);
-            DoLog(0) && (Log() << Verbose(0) << "\t-t x1 x2 x3\tTranslate all atoms by this vector (x1,x2,x3)." << endl);
-            DoLog(0) && (Log() << Verbose(0) << "\t-T x1 x2 x3\tTranslate periodically all atoms by this vector (x1,x2,x3)." << endl);
-            DoLog(0) && (Log() << Verbose(0) << "\t-u rho\tsuspend in water solution and output necessary cell lengths, average density rho and repetition." << endl);
-            DoLog(0) && (Log() << Verbose(0) << "\t-v\t\tsets verbosity (more is more)." << endl);
-            DoLog(0) && (Log() << Verbose(0) << "\t-V\t\tGives version information." << endl);
-            DoLog(0) && (Log() << Verbose(0) << "\t-X\t\tset default name of a molecule." << endl);
-            DoLog(0) && (Log() << Verbose(0) << "Note: config files must not begin with '-' !" << endl);
-            return (1);
+            ArgcList.push_back(argptr-1);
+            return(1);
             break;
           case 'v':
-            while (argv[argptr-1][verbosity+1] == 'v') {
-              verbosity++;
-            }
-            setVerbosity(verbosity);
-            DoLog(0) && (Log() << Verbose(0) << "Setting verbosity to " << verbosity << "." << endl);
+            ArgcList.push_back(argptr-1);
+            return(1);
             break;
           case 'V':
-            DoLog(0) && (Log() << Verbose(0) << argv[0] << " " << VERSIONSTRING << endl);
-            DoLog(0) && (Log() << Verbose(0) << "Build your own molecule position set." << endl);
-            return (1);
+            ArgcList.push_back(argptr-1);
+            ArgcList.push_back(argptr);
+            argptr++;
             break;
           case 'B':
@@ -2511,35 +2472,8 @@
 };
 
-/***************************************** Functions used to build all menus **********************/
-
-void populateEditMoleculesMenu(Menu* editMoleculesMenu,MoleculeListClass *molecules, config *configuration, periodentafel *periode){
-  // build the EditMoleculesMenu
-  Action *createMoleculeAction = new MethodAction("createMoleculeAction",boost::bind(&MoleculeListClass::createNewMolecule,molecules,periode));
-  new ActionMenuItem('c',"create new molecule",editMoleculesMenu,createMoleculeAction);
-
-  Action *loadMoleculeAction = new MethodAction("loadMoleculeAction",boost::bind(&MoleculeListClass::loadFromXYZ,molecules,periode));
-  new ActionMenuItem('l',"load molecule from xyz file",editMoleculesMenu,loadMoleculeAction);
-
-  Action *changeFilenameAction = new ChangeMoleculeNameAction(molecules);
-  new ActionMenuItem('n',"change molecule's name",editMoleculesMenu,changeFilenameAction);
-
-  Action *giveFilenameAction = new MethodAction("giveFilenameAction",boost::bind(&MoleculeListClass::setMoleculeFilename,molecules));
-  new ActionMenuItem('N',"give molecules filename",editMoleculesMenu,giveFilenameAction);
-
-  Action *parseAtomsAction = new MethodAction("parseAtomsAction",boost::bind(&MoleculeListClass::parseXYZIntoMolecule,molecules));
-  new ActionMenuItem('p',"parse atoms in xyz file into molecule",editMoleculesMenu,parseAtomsAction);
-
-  Action *eraseMoleculeAction = new MethodAction("eraseMoleculeAction",boost::bind(&MoleculeListClass::eraseMolecule,molecules));
-  new ActionMenuItem('r',"remove a molecule",editMoleculesMenu,eraseMoleculeAction);
-
-}
-
-
 /********************************************** Main routine **************************************/
 
-void cleanUp(config *configuration){
-  UIFactory::purgeInstance();
+void cleanUp(){
   World::purgeInstance();
-  delete(configuration);
   Log() << Verbose(0) <<  "Maximum of allocated memory: "
     << MemoryUsageObserver::getInstance()->getMaximumUsedMemory() << endl;
@@ -2549,4 +2483,7 @@
   logger::purgeInstance();
   errorLogger::purgeInstance();
+  UIFactory::purgeInstance();
+  MapOfActions::purgeInstance();
+  CommandLineParser::purgeInstance();
   ActionRegistry::purgeInstance();
   ActionHistory::purgeInstance();
@@ -2555,12 +2492,12 @@
 int main(int argc, char **argv)
 {
-    molecule *mol = NULL;
-    config *configuration = new config;
+    config *configuration = World::getInstance().getConfig();
     Vector x, y, z, n;
     ifstream test;
     ofstream output;
     string line;
-    char *ConfigFileName = NULL;
-    int j;
+    char **Arguments = NULL;
+    int ArgcSize = 0;
+    bool ArgumentsCopied = false;
 
     cout << ESPACKVersion << endl;
@@ -2569,39 +2506,38 @@
     // need to init the history before any action is created
     ActionHistory::init();
-    /* structure of ParseCommandLineOptions will be refactored later */
-    j = ParseCommandLineOptions(argc, argv,  World::getInstance().getMolecules(), World::getInstance().getPeriode(), *configuration, ConfigFileName);
-    switch (j){
-        case 255:
-        case 2:
-        case 1:
-            cleanUp(configuration);
-            return (j == 1 ? 0 : j);
-        default:
-            break;
+
+    // Parse command line options and if present create respective UI
+    {
+      list<int> ArgcList;
+      ArgcList.push_back(0); // push back program!
+      ArgcList.push_back(1); // push back config file name
+      char ConfigFileName[MAXSTRINGSIZE];
+      // handle arguments by ParseCommandLineOptions()
+      ParseCommandLineOptions(argc,argv,World::getInstance().getMolecules(),World::getInstance().getPeriode(),*World::getInstance().getConfig(), (char *&)ConfigFileName, ArgcList);
+      // copy all remaining arguments to a new argv
+      Arguments = Malloc<char *>(ArgcList.size(), "main - **Arguments");
+      cout << "The following arguments are handled by CommandLineParser: ";
+      for (list<int>::iterator ArgcRunner = ArgcList.begin(); ArgcRunner != ArgcList.end(); ++ArgcRunner) {
+        Arguments[ArgcSize] = Malloc<char>(strlen(argv[*ArgcRunner])+2, "main - *Arguments[]");
+        strcpy(Arguments[ArgcSize], argv[*ArgcRunner]);
+        cout << " " << argv[*ArgcRunner];
+        ArgcSize++;
+      }
+      cout << endl;
+      ArgumentsCopied = true;
+      // handle remaining arguments by CommandLineParser
+      MapOfActions::getInstance().AddOptionsToParser();
+      CommandLineParser::getInstance().Run(ArgcSize,Arguments);
+      if (!CommandLineParser::getInstance().isEmpty()) {
+        DoLog(0) && (Log() << Verbose(0) << "Setting UI to CommandLine." << endl);
+        UIFactory::makeUserInterface(UIFactory::CommandLine);
+      } else {
+        DoLog(0) && (Log() << Verbose(0) << "Setting UI to Text." << endl);
+        UIFactory::makeUserInterface(UIFactory::Text);
+      }
     }
-    if(World::getInstance().numMolecules() == 0){
-        mol = World::getInstance().createMolecule();
-        World::getInstance().getMolecules()->insert(mol);
-        cout << "Molecule created" << endl;
-        if(World::getInstance().getDomain()[0] == 0.){
-            Log() << Verbose(0) << "enter lower tridiagonal form of basis matrix" << endl << endl;
-            for(int i = 0;i < 6;i++){
-                Log() << Verbose(1) << "Cell size" << i << ": ";
-                cin >> World::getInstance().getDomain()[i];
-            }
-        }
-        mol->ActiveFlag = true;
-    }
 
     {
-      cout << ESPACKVersion << endl;
-
-      setVerbosity(0);
-
-      menuPopulaters populaters;
-      populaters.MakeEditMoleculesMenu = populateEditMoleculesMenu;
-
-      UIFactory::makeUserInterface(UIFactory::Text);
-      MainWindow *mainWindow = UIFactory::getInstance().makeMainWindow(populaters,World::getInstance().getMolecules(), configuration, World::getInstance().getPeriode(), ConfigFileName);
+      MainWindow *mainWindow = UIFactory::getInstance().makeMainWindow();
       mainWindow->display();
       delete mainWindow;
@@ -2614,6 +2550,12 @@
         Log() << Verbose(0) << "Saving of elements.db failed." << endl;
 
-  cleanUp(configuration);
-
+  // free the new argv
+  if (ArgumentsCopied) {
+    for (int i=0; i<ArgcSize;i++)
+      Free(&Arguments[i]);
+    Free(&Arguments);
+  }
+
+  cleanUp();
   Memory::getState();
   return (0);
Index: src/molecule.hpp
===================================================================
--- src/molecule.hpp	(revision 12872df33639e521d4b0225d6064ea91bd4f18e8)
+++ src/molecule.hpp	(revision f941b14c7a92d23575eccdfcd7bbb7ef127d1bad)
@@ -35,4 +35,6 @@
 #include "Patterns/Observer.hpp"
 #include "Patterns/Cacheable.hpp"
+
+#include "Descriptors/MoleculeDescriptor_impl.hpp"
 
 /****************************************** forward declarations *****************************/
Index: src/unittests/Makefile.am
===================================================================
--- src/unittests/Makefile.am	(revision 12872df33639e521d4b0225d6064ea91bd4f18e8)
+++ src/unittests/Makefile.am	(revision f941b14c7a92d23575eccdfcd7bbb7ef127d1bad)
@@ -1,2 +1,5 @@
+# PLEASE adhere to the alphabetical ordering in this Makefile!
+# Also indentation by a single tab
+
 INCLUDES = -I$(top_srcdir)/src
 
@@ -32,4 +35,5 @@
   PlaneUnittest \
   ObserverTest \
+  ParserUnitTest \
   SingletonTest \
   StackClassUnitTest \
@@ -73,4 +77,5 @@
   PlaneUnittest.cpp \
   ObserverTest.cpp \
+  ParserUnitTest.cpp \
   SingletonTest.cpp \
   stackclassunittest.cpp \
@@ -114,4 +119,7 @@
   
 
+ActionSequenceTest_SOURCES = UnitTestMain.cpp ../../../TestRunnerClient.hpp ActionSequenceTest.cpp ActionSequenceTest.hpp
+ActionSequenceTest_LDADD = ${ALLLIBS}
+
 ActOnAllUnitTest_SOURCES = UnitTestMain.cpp ../test/ActOnAllTest.hpp ActOnAllUnitTest.cpp ActOnAllUnitTest.hpp
 ActOnAllUnitTest_LDADD = ${ALLLIBS}
@@ -132,7 +140,13 @@
 atomsCalculationTest_LDADD = ${ALLLIBS}
 
+AtomDescriptorTest_SOURCES = UnitTestMain.cpp AtomDescriptorTest.cpp AtomDescriptorTest.hpp
+AtomDescriptorTest_LDADD = ${ALLLIBS}
+
 BondGraphUnitTest_SOURCES = UnitTestMain.cpp bondgraphunittest.cpp bondgraphunittest.hpp
 BondGraphUnitTest_LDADD = ${ALLLIBS}
 
+CacheableTest_SOURCES = UnitTestMain.cpp CacheableTest.cpp CacheableTest.hpp
+CacheableTest_LDADD = ${ALLLIBS}
+
 CountBondsUnitTest_SOURCES = UnitTestMain.cpp CountBondsUnitTest.cpp CountBondsUnitTest.hpp
 CountBondsUnitTest_LDADD = ${ALLLIBS}
@@ -162,4 +176,7 @@
 LogUnitTest_LDADD = ${ALLLIBS}
 
+manipulateAtomsTest_SOURCES = UnitTestMain.cpp manipulateAtomsTest.cpp manipulateAtomsTest.hpp
+manipulateAtomsTest_LDADD = ${ALLLIBS}
+
 MemoryAllocatorUnitTest_SOURCES = UnitTestMain.cpp memoryallocatorunittest.cpp memoryallocatorunittest.hpp 
 MemoryAllocatorUnitTest_LDADD = ${ALLLIBS}
@@ -171,4 +188,10 @@
 MoleculeDescriptorTest_LDADD = ${ALLLIBS}
 
+ObserverTest_SOURCES = UnitTestMain.cpp ObserverTest.cpp ObserverTest.hpp
+ObserverTest_LDADD = ${ALLLIBS}
+
+ParserUnitTest_SOURCES = UnitTestMain.cpp ParserUnitTest.cpp ParserUnitTest.hpp
+ParserUnitTest_LDADD = ${ALLLIBS}
+
 PlaneUnittest_SOURCES = UnitTestMain.cpp PlaneUnittest.cpp PlaneUnittest.hpp
 PlaneUnittest_LDADD = ${ALLLIBS}
@@ -189,25 +212,9 @@
 Tesselation_InOutsideUnitTest_LDADD = ${ALLLIBS}
 
+TestRunner_SOURCES = TestRunnerMain.cpp $(TESTSOURCES) $(TESTHEADERS)
+TestRunner_LDADD = ${ALLLIBS}
+
 VectorUnitTest_SOURCES = UnitTestMain.cpp vectorunittest.cpp vectorunittest.hpp 
 VectorUnitTest_LDADD = ${ALLLIBS}
 
-ActionSequenceTest_SOURCES = UnitTestMain.cpp ../../../TestRunnerClient.hpp ActionSequenceTest.cpp ActionSequenceTest.hpp
-ActionSequenceTest_LDADD = ${ALLLIBS}
-
-ObserverTest_SOURCES = UnitTestMain.cpp ObserverTest.cpp ObserverTest.hpp
-ObserverTest_LDADD = ${ALLLIBS}
-
-CacheableTest_SOURCES = UnitTestMain.cpp CacheableTest.cpp CacheableTest.hpp
-CacheableTest_LDADD = ${ALLLIBS}
-
-AtomDescriptorTest_SOURCES = UnitTestMain.cpp AtomDescriptorTest.cpp AtomDescriptorTest.hpp
-AtomDescriptorTest_LDADD = ${ALLLIBS}
-
-manipulateAtomsTest_SOURCES = UnitTestMain.cpp manipulateAtomsTest.cpp manipulateAtomsTest.hpp
-manipulateAtomsTest_LDADD = ${ALLLIBS}
-
-TestRunner_SOURCES = TestRunnerMain.cpp $(TESTSOURCES) $(TESTHEADERS)
-TestRunner_LDADD = ${ALLLIBS}
-
 #AUTOMAKE_OPTIONS = parallel-tests
-
Index: src/unittests/MapofActionsTest.cpp
===================================================================
--- src/unittests/MapofActionsTest.cpp	(revision f941b14c7a92d23575eccdfcd7bbb7ef127d1bad)
+++ src/unittests/MapofActionsTest.cpp	(revision f941b14c7a92d23575eccdfcd7bbb7ef127d1bad)
@@ -0,0 +1,65 @@
+/*
+ * analysisbondsunittest.cpp
+ *
+ *  Created on: Nov 7, 2009
+ *      Author: heber
+ */
+
+using namespace std;
+
+#include <cppunit/CompilerOutputter.h>
+#include <cppunit/extensions/TestFactoryRegistry.h>
+#include <cppunit/ui/text/TestRunner.h>
+
+#include <iostream>
+#include <stdio.h>
+#include <cstring>
+
+#include "MapOfActionsTest.hpp"
+#include "Actions/MapOfActions.hpp"
+
+#ifdef HAVE_TESTRUNNER
+#include "UnitTestMain.hpp"
+#endif /*HAVE_TESTRUNNER*/
+
+/********************************************** Test classes **************************************/
+
+// Registers the fixture into the 'registry'
+CPPUNIT_TEST_SUITE_REGISTRATION( MapOfActionsTest );
+
+
+void MapOfActionsTest::setUp()
+{
+  MapOfActions *ActionData = MapOfActions::getInstance();
+};
+
+
+void MapOfActionsTest::tearDown()
+{
+  // note that all the atoms are cleaned by TestMolecule
+  MapOfActions::purgeInstance();
+};
+
+/** UnitTest: check whether each short form action also has a description (the other way round is not always true)
+ */
+void MapOfActionsTest::ShortFormConsistencyTest()
+{
+  for (map<string, string>::iterator ShortFormRunner = ActionData->ShortFormMap.begin(); ShortFormRunner = ActionData->ShortFormMap.begin(); ++ShortFormRunner) {
+    CPPUNIT_ASSERT( ActionData->DescriptionMap.find(ShortFormRunner->first) != ActionData->DescriptionMap.end() && "There is a short form without description.");
+  }
+};
+
+/** UnitTest: check whether each action appears in a list one of the option lists
+ */
+void MapOfActionsTest::OptionsListsConsistencyTest()
+{
+  bool haveFound = false;
+  for (map<string, string>::iterator ActionRunner = ActionData->DescriptionMap.begin(); ShortFormRunner = ActionData->DescriptionMap.begin(); ++ShortFormRunner) {
+    haveFound = haveFound || (ActionData->generic.find(ActionRunner->first) != ActionData->generic.end());
+    haveFound = haveFound || (ActionData->config.find(ActionRunner->first) != ActionData->config.end());
+    haveFound = haveFound || (ActionData->hidden.find(ActionRunner->first) != ActionData->hidden.end());
+    haveFound = haveFound || (ActionData->visible.find(ActionRunner->first) != ActionData->visible.end());
+    CPPUNIT_ASSERT_EQUAL( true , haveFound);
+  }
+};
+
Index: src/unittests/MapofActionsTest.hpp
===================================================================
--- src/unittests/MapofActionsTest.hpp	(revision f941b14c7a92d23575eccdfcd7bbb7ef127d1bad)
+++ src/unittests/MapofActionsTest.hpp	(revision f941b14c7a92d23575eccdfcd7bbb7ef127d1bad)
@@ -0,0 +1,37 @@
+/*
+ * analysisbondsunittest.hpp
+ *
+ *  Created on: Nov 7, 2009
+ *      Author: heber
+ */
+
+#ifndef MAPOFACTIONS_HPP_
+#define MAPOFACTIONS_HPP_
+
+#include <cppunit/extensions/HelperMacros.h>
+
+class BondGraph;
+class element;
+class molecule;
+class periodentafel;
+
+/********************************************** Test classes **************************************/
+
+class MapOfActionsTest : public CppUnit::TestFixture
+{
+    CPPUNIT_TEST_SUITE( MapOfActionsTest) ;
+    CPPUNIT_TEST ( ShortFormConsistencyTest );
+    CPPUNIT_TEST ( OptionsListsConsistencyTest );
+    CPPUNIT_TEST_SUITE_END();
+
+public:
+      void setUp();
+      void tearDown();
+      void ShortFormConsistencyTest();
+      void OptionsListsConsistencyTest();
+
+private:
+
+      MapOfActions *ActionData;
+
+#endif /* MAPOFACTIONS_HPP_ */
Index: src/unittests/ParserUnitTest.cpp
===================================================================
--- src/unittests/ParserUnitTest.cpp	(revision f941b14c7a92d23575eccdfcd7bbb7ef127d1bad)
+++ src/unittests/ParserUnitTest.cpp	(revision f941b14c7a92d23575eccdfcd7bbb7ef127d1bad)
@@ -0,0 +1,186 @@
+/*
+ * ParserUnitTest.cpp
+ *
+ *  Created on: Mar 3, 2010
+ *      Author: metzler
+ */
+
+#include "ParserUnitTest.hpp"
+
+#include <cppunit/CompilerOutputter.h>
+#include <cppunit/extensions/TestFactoryRegistry.h>
+#include <cppunit/ui/text/TestRunner.h>
+
+#include "Parser/XyzParser.hpp"
+#include "Parser/TremoloParser.hpp"
+#include "World.hpp"
+#include "atom.hpp"
+#include "element.hpp"
+#include "periodentafel.hpp"
+#include "Descriptors/AtomTypeDescriptor.hpp"
+
+#ifdef HAVE_TESTRUNNER
+#include "UnitTestMain.hpp"
+#endif /*HAVE_TESTRUNNER*/
+
+using namespace std;
+
+// Registers the fixture into the 'registry'
+CPPUNIT_TEST_SUITE_REGISTRATION( ParserUnitTest );
+
+
+void ParserUnitTest::setUp() {
+  element* oxygen = new element();
+  oxygen->symbol[0] = 'O';
+  oxygen->Z = 8;
+  World::getInstance().getPeriode()->AddElement(oxygen);
+
+  element* hydrogen = new element();
+  hydrogen->symbol[0] = 'H';
+  hydrogen->Z = 1;
+  World::getInstance().getPeriode()->AddElement(hydrogen);
+}
+
+void ParserUnitTest::tearDown() {
+  World::purgeInstance();
+}
+
+/************************************ tests ***********************************/
+
+void ParserUnitTest::rewriteAnXyzTest() {
+  cout << "Testing the XYZ parser." << endl;
+  XyzParser* testParser = new XyzParser();
+  string waterXyz = "3\nH2O: water molecule\nO\t0.000000\t0.000000\t0.000000\nH\t0.758602\t0.000000\t0.504284\nH\t0.758602\t0.000000\t-0.504284\n";
+  stringstream input;
+  input << waterXyz;
+  testParser->load(&input);
+
+  CPPUNIT_ASSERT_EQUAL(3, World::getInstance().numAtoms());
+
+  string newWaterXyz = "";
+  stringstream output;
+  testParser->save(&output);
+  newWaterXyz = output.str();
+
+  CPPUNIT_ASSERT(waterXyz == newWaterXyz);
+}
+
+void ParserUnitTest::readTremoloPreliminaryCommentsTest() {
+  cout << "Testing the tremolo parser." << endl;
+  TremoloParser* testParser = new TremoloParser();
+  stringstream input, output;
+  string waterTremolo;
+
+  // Atomdata beginning with "# ATOMDATA"
+  waterTremolo = "# ATOMDATA\tId\tname\tType\tx=3\n";
+  input << waterTremolo;
+  testParser->load(&input);
+  testParser->save(&output);
+  CPPUNIT_ASSERT(waterTremolo == output.str());
+  input.clear();
+  output.clear();
+
+  // Atomdata beginning with "#ATOMDATA"
+  waterTremolo = "#\n#ATOMDATA Id name Type x=3\n1 hydrogen H 3.0 4.5 0.1\n\n";
+  input << waterTremolo;
+  testParser->load(&input);
+  testParser->save(&output);
+  CPPUNIT_ASSERT(output.str().find("hydrogen") != string::npos);
+  input.clear();
+  output.clear();
+
+  // Invalid key in Atomdata line
+  waterTremolo = "#\n#ATOMDATA Id name foo Type x=3\n\n\n";
+  input << waterTremolo;
+  testParser->load(&input);
+  //TODO: proove invalidity
+  input.clear();
+}
+
+void ParserUnitTest::readTremoloCoordinatesTest() {
+  TremoloParser* testParser = new TremoloParser();
+  stringstream input;
+  string waterTremolo;
+
+  // One simple data line
+  waterTremolo = "#\n#ATOMDATA Id name Type x=3\n1 hydrogen H 3.0 4.5 0.1\n\n";
+  input << waterTremolo;
+  testParser->load(&input);
+  CPPUNIT_ASSERT(World::getInstance().getAtom(AtomByType(1))->x[0] == 3.0);
+  input.clear();
+}
+
+void ParserUnitTest::readTremoloVelocityTest() {
+  TremoloParser* testParser = new TremoloParser();
+  stringstream input;
+  string waterTremolo;
+
+  // One simple data line
+  waterTremolo = "#\n#ATOMDATA Id name Type u=3\n1 hydrogen H 3.0 4.5 0.1\n\n";
+  input << waterTremolo;
+  testParser->load(&input);
+  CPPUNIT_ASSERT(World::getInstance().getAtom(AtomByType(1))->v[0] == 3.0);
+  input.clear();
+}
+
+void ParserUnitTest::readTremoloNeighborInformationTest() {
+  TremoloParser* testParser = new TremoloParser();
+  stringstream input;
+  string waterTremolo;
+
+  // Neighbor data
+  waterTremolo = "#\n#ATOMDATA Id Type neighbors=2\n1 H 3 0\n2 H 3 0\n3 O 1 2\n";
+  input << waterTremolo;
+  testParser->load(&input);
+
+  CPPUNIT_ASSERT_EQUAL(3, World::getInstance().numAtoms());
+  CPPUNIT_ASSERT(World::getInstance().getAtom(AtomByType(8))->
+      IsBondedTo(World::getInstance().getAtom(AtomByType(1))));
+  input.clear();
+}
+
+void ParserUnitTest::readAndWriteTremoloImprDataInformationTest() {
+  TremoloParser* testParser = new TremoloParser();
+  stringstream input, output;
+  string waterTremolo;
+
+  // Neighbor data
+  waterTremolo = "#\n#ATOMDATA Id Type imprData\n8 H 9-10\n9 H 10-8,8-10\n10 O -\n";
+  input << waterTremolo;
+  testParser->load(&input);
+  testParser->save(&output);
+  CPPUNIT_ASSERT_EQUAL(3, World::getInstance().numAtoms());
+  CPPUNIT_ASSERT(output.str().find("2-0,0-2") != string::npos);
+  input.clear();
+  output.clear();
+}
+
+void ParserUnitTest::readAndWriteTremoloTorsionInformationTest() {
+  TremoloParser* testParser = new TremoloParser();
+  stringstream input, output;
+  string waterTremolo;
+
+  // Neighbor data
+  waterTremolo = "#\n#ATOMDATA Id Type torsion\n8 H 9-10\n9 H 10-8,8-10\n10 O -\n";
+  input << waterTremolo;
+  testParser->load(&input);
+  testParser->save(&output);
+  CPPUNIT_ASSERT_EQUAL(3, World::getInstance().numAtoms());
+  CPPUNIT_ASSERT(output.str().find("2-0,0-2") != string::npos);
+  input.clear();
+  output.clear();
+}
+
+void ParserUnitTest::writeTremoloTest() {
+  TremoloParser* testParser = new TremoloParser();
+  stringstream output;
+
+  // with the maximum number of fields and minimal information, default values are printed
+  atom* newAtom = World::getInstance().createAtom();
+  newAtom->type = World::getInstance().getPeriode()->FindElement(1);
+  testParser->setFieldsForSave("x=3 u=3 F stress Id neighbors=5 imprData GroupMeasureTypeNo Type extType name resName chainID resSeq occupancy tempFactor segID Charge charge GrpTypeNo torsion");
+  testParser->save(&output);
+  CPPUNIT_ASSERT(output.str() == "# ATOMDATA\tx=3\tu=3\tF\tstress\tId\tneighbors=5\timprData\tGroupMeasureTypeNo\tType\textType\tname\tresName\tchainID\tresSeq\toccupancy\ttempFactor\tsegID\tCharge\tcharge\tGrpTypeNo\ttorsion\n0\t0\t0\t0\t0\t0\t0\t0\t0\t0\t0\t0\t0\t0\t-\t0\tH\t-\t-\t-\t0\t0\t0\t0\t0\t0\t0\t0\t-\t\n");
+
+  cout << "testing the tremolo parser is done" << endl;
+}
Index: src/unittests/ParserUnitTest.hpp
===================================================================
--- src/unittests/ParserUnitTest.hpp	(revision f941b14c7a92d23575eccdfcd7bbb7ef127d1bad)
+++ src/unittests/ParserUnitTest.hpp	(revision f941b14c7a92d23575eccdfcd7bbb7ef127d1bad)
@@ -0,0 +1,40 @@
+/*
+ * ParserUnitTest.hpp
+ *
+ *  Created on: Mar 3, 2010
+ *      Author: metzler
+ */
+#ifndef PARSERUNITTEST_HPP_
+#define PARSERUNITTEST_HPP_
+
+#include <cppunit/extensions/HelperMacros.h>
+#include <string>
+
+class ParserUnitTest :  public CppUnit::TestFixture
+{
+  CPPUNIT_TEST_SUITE( ParserUnitTest ) ;
+  CPPUNIT_TEST ( rewriteAnXyzTest );
+  CPPUNIT_TEST ( readTremoloPreliminaryCommentsTest );
+  CPPUNIT_TEST ( readTremoloCoordinatesTest );
+  CPPUNIT_TEST ( readTremoloVelocityTest );
+  CPPUNIT_TEST ( readTremoloNeighborInformationTest );
+  CPPUNIT_TEST ( readAndWriteTremoloImprDataInformationTest );
+  CPPUNIT_TEST ( readAndWriteTremoloTorsionInformationTest );
+  CPPUNIT_TEST ( writeTremoloTest );
+  CPPUNIT_TEST_SUITE_END();
+
+public:
+  void setUp();
+  void tearDown();
+
+  void rewriteAnXyzTest();
+  void readTremoloPreliminaryCommentsTest();
+  void readTremoloCoordinatesTest();
+  void readTremoloVelocityTest();
+  void readTremoloNeighborInformationTest();
+  void readAndWriteTremoloImprDataInformationTest();
+  void readAndWriteTremoloTorsionInformationTest();
+  void writeTremoloTest();
+};
+
+#endif /* PARSERUNITTEST_HPP_ */
Index: src/unittests/SingletonTest.cpp
===================================================================
--- src/unittests/SingletonTest.cpp	(revision 12872df33639e521d4b0225d6064ea91bd4f18e8)
+++ src/unittests/SingletonTest.cpp	(revision f941b14c7a92d23575eccdfcd7bbb7ef127d1bad)
@@ -52,5 +52,5 @@
     count1++;
   }
-  // explicit copy constructor to catch if thsi is ever called
+  // explicit copy constructor to catch if this is ever called
   SingletonStub2(const SingletonStub2&){
     CPPUNIT_FAIL    ( "Copy constructor of Singleton called" );
Index: src/unittests/TestRunnerMain.cpp
===================================================================
--- src/unittests/TestRunnerMain.cpp	(revision 12872df33639e521d4b0225d6064ea91bd4f18e8)
+++ src/unittests/TestRunnerMain.cpp	(revision f941b14c7a92d23575eccdfcd7bbb7ef127d1bad)
@@ -6,8 +6,17 @@
  */
 
+// include config.h
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#ifdef HAVE_ECUT
 // give the main function its correct name
 #define CPPUNIT_MAIN main
-
 // include the TestRunnerClient file containing the main class
 #include "../../../TestRunnerClient.h"
 #include "../../../TestRunnerClient.cpp"
+#else
+#include "UnitTestMain.cpp"
+#endif
+
