Index: src/Actions/MoleculeAction/RotateAroundSelfByAngleAction.cpp
===================================================================
--- src/Actions/MoleculeAction/RotateAroundSelfByAngleAction.cpp	(revision 0b2ce98def2d6ab9548ba5ac25acbb2ab5bc233c)
+++ src/Actions/MoleculeAction/RotateAroundSelfByAngleAction.cpp	(revision 1fd67574a5cc6c07a5638d5d343eae3b6bbdb9bf)
@@ -20,6 +20,4 @@
 #include "Helpers/MemDebug.hpp"
 
-#include "Actions/MoleculeAction/RotateAroundSelfByAngleAction.hpp"
-#include "Actions/ActionRegistry.hpp"
 #include "Helpers/Log.hpp"
 #include "Helpers/Verbose.hpp"
@@ -36,59 +34,15 @@
 using namespace std;
 
-#include "UIElements/UIFactory.hpp"
-#include "UIElements/Dialog.hpp"
-#include "Actions/ValueStorage.hpp"
+#include "Actions/MoleculeAction/RotateAroundSelfByAngleAction.hpp"
 
-/****** MoleculeRotateAroundSelfByAngleAction *****/
-
-// memento to remember the state when undoing
-
-class MoleculeRotateAroundSelfByAngleState : public ActionState {
-public:
-    MoleculeRotateAroundSelfByAngleState(molecule * const _mol, const Vector &_Axis, const double _alpha) :
-      mol(_mol),
-      Axis(_Axis),
-      alpha(_alpha)
-    {}
-    molecule* const mol;
-    Vector Axis;
-    double alpha;
-};
-
-const char MoleculeRotateAroundSelfByAngleAction::NAME[] = "rotate-self";
-
-MoleculeRotateAroundSelfByAngleAction::MoleculeRotateAroundSelfByAngleAction() :
-  Action(NAME)
-{}
-
-MoleculeRotateAroundSelfByAngleAction::~MoleculeRotateAroundSelfByAngleAction()
-{}
-
-void MoleculeRotateAroundSelfByAngle(const Vector &Axis, const double angle) {
-  ValueStorage::getInstance().setCurrentValue(MoleculeRotateAroundSelfByAngleAction::NAME, angle);
-  ValueStorage::getInstance().setCurrentValue("position", Axis);
-  ActionRegistry::getInstance().getActionByName(MoleculeRotateAroundSelfByAngleAction::NAME)->call(Action::NonInteractive);
-};
-
-void MoleculeRotateAroundSelfByAngleAction::getParametersfromValueStorage()
-{};
-
-Dialog* MoleculeRotateAroundSelfByAngleAction::fillDialog(Dialog *dialog) {
-  ASSERT(dialog,"No Dialog given when filling action dialog");
-
-  dialog->queryDouble(NAME, ValueStorage::getInstance().getDescription(NAME));
-  dialog->queryVector("position", false, ValueStorage::getInstance().getDescription(NAME));
-
-  return dialog;
-}
-
+// and construct the stuff
+#include "RotateAroundSelfByAngleAction.def"
+#include "Action_impl_pre.hpp"
+/** =========== define the function ====================== */
 Action::state_ptr MoleculeRotateAroundSelfByAngleAction::performCall() {
   molecule *mol = NULL;
-  double alpha = 0.;
-  Vector Axis;
 
-  // obtain angle and axis around which rotate
-  ValueStorage::getInstance().queryCurrentValue(NAME, alpha);
-  ValueStorage::getInstance().queryCurrentValue("position", Axis);
+  // obtain information
+  getParametersfromValueStorage();
 
   // check whether a single atom and molecule is selected
@@ -98,22 +52,22 @@
 
   // check whether Axis is valid
-  if (Axis.IsZero())
+  if (params.Axis.IsZero())
     return Action::failure;
 
   // convert from degrees to radian
-  alpha *= M_PI/180.;
+  params.angle *= M_PI/180.;
 
   // Creation Line that is the rotation axis
   Vector *CenterOfGravity = mol->DetermineCenterOfGravity();
-  Line RotationAxis(*CenterOfGravity, Axis);
+  Line RotationAxis(*CenterOfGravity, params.Axis);
   delete(CenterOfGravity);
-  DoLog(0) && (Log() << Verbose(0) << "Rotate around self by " << alpha << " along " << RotationAxis << "." << endl);
+  DoLog(0) && (Log() << Verbose(0) << "Rotate around self by " << params.angle << " along " << RotationAxis << "." << endl);
 
   for (molecule::iterator iter = mol->begin(); iter != mol->end(); ++iter) {
-    (*iter)->setPosition(RotationAxis.rotateVector((*iter)->getPosition(), alpha));
+    (*iter)->setPosition(RotationAxis.rotateVector((*iter)->getPosition(), params.angle));
   }
   DoLog(0) && (Log() << Verbose(0) << "done." << endl);
 
-  return Action::state_ptr(new MoleculeRotateAroundSelfByAngleState(mol, Axis, alpha));
+  return Action::state_ptr(new MoleculeRotateAroundSelfByAngleState(mol, params));
 }
 
@@ -122,9 +76,9 @@
 
   Vector *CenterOfGravity = state->mol->DetermineCenterOfGravity();
-  Line RotationAxis(*CenterOfGravity, state->Axis);
+  Line RotationAxis(*CenterOfGravity, state->params.Axis);
   delete(CenterOfGravity);
 
   for (molecule::iterator iter = state->mol->begin(); iter != state->mol->end(); ++iter) {
-    (*iter)->setPosition(RotationAxis.rotateVector((*iter)->getPosition(), -state->alpha));
+    (*iter)->setPosition(RotationAxis.rotateVector((*iter)->getPosition(), -state->params.angle));
   }
 
@@ -136,9 +90,9 @@
 
   Vector *CenterOfGravity = state->mol->DetermineCenterOfGravity();
-  Line RotationAxis(*CenterOfGravity, state->Axis);
+  Line RotationAxis(*CenterOfGravity, state->params.Axis);
   delete(CenterOfGravity);
 
   for (molecule::iterator iter = state->mol->begin(); iter != state->mol->end(); ++iter) {
-    (*iter)->setPosition(RotationAxis.rotateVector((*iter)->getPosition(), state->alpha));
+    (*iter)->setPosition(RotationAxis.rotateVector((*iter)->getPosition(), state->params.angle));
   }
 
@@ -157,2 +111,3 @@
   return NAME;
 }
+/** =========== end of function ====================== */
