Index: doc/userguide/userguide.xml
===================================================================
--- doc/userguide/userguide.xml	(revision af78afe6d51863cb0db3ce69045752ab4f7668df)
+++ doc/userguide/userguide.xml	(revision 5f869d731c0e018ae107f17a253937a99d0c6c9b)
@@ -100,6 +100,13 @@
             spheres, cubes, or cylinders.</para>
           </listitem>
-          <listitem>World refers to the whole of the molecular system, i.e. all atoms with coordinates and element type (over all time steps), all bonds between pairs of atoms, the size of the simulation domain. This state is also referred to as the state.</listitem>
-          <listitem>Time step is the current discrete position in time. Molecular dynamics simulations are executed in discrete (but very small) time steps. Each atom has a distinct position per time step. The discrete positions over the discrete time steps samples its trajectory during a simulation.</listitem>
+          <listitem>World refers to the whole of the molecular system, i.e. all 
+          atoms with coordinates and element type (over all time steps), all 
+          bonds between pairs of atoms, the size of the simulation domain. 
+          This is also referred to as the state.</listitem>
+          <listitem>Time step is the current discrete position in time. Molecular 
+          dynamics simulations are executed in discrete (but very small) time 
+          steps.  Each atom has a distinct position per time step. The discrete 
+          positions over the discrete time steps samples its trajectory during a 
+          simulation.</listitem>
         </itemizedlist>
       </section>
@@ -110,7 +117,9 @@
         respect to their functionality, while newer features or actions are
         probably missing. This should be a clear sign to you that these are
-        probably not safe to use yet. If you nonetheless require them, you         should acquire some familiarity with the code itself. This suggests
-        changing to the developer documentation which is maintained along with
-        the source code with <productname>doxygen</productname>.</para>
+        probably not safe to use yet. If you nonetheless require them, you 
+        should acquire some familiarity with the code itself. This suggests
+        changing to the developer documentation which is maintained along 
+        with the source code with <productname>doxygen</productname>.
+        </para>
       </section>
     </section>
@@ -313,6 +322,7 @@
       </formalpara>
       <note>
-        <para>Note further that when placing a slew of commands in a script file it is generally recommended to use the above formatting: One command or option per line and each</para>
-        <para>option receives an extra tab for indentation.</para>
+        <para>Note further that when placing a slew of commands in a script file
+         it is generally recommended to use the above formatting: One command 
+         or option per line and each receives an extra tab for indentation.</para>
       </note>
       <section xml:id="preliminaries">
@@ -726,4 +736,88 @@
           <para>This translates all selected shapes by 5 along the x
           axis.</para>
+        </section>
+      </section>
+      <section xml:id="geometry">
+        <title xml:id="geometry.title">Geometry Objects</title>
+        <para>Although we use the term geometry objects in the title, we 
+        actually mean vectors, i.e. a position or direction in the 
+        three-dimensional space. But maybe we have need for the more
+        general term in the future.</para>
+        <para>Vectors are required as input to many of the Actions further 
+        below: translating atoms, rotating atoms around a specific axis,
+        aligning a molecule with a vector, ...</para>
+        <para>Therefore, vectors can be stored and referenced using a given
+        name. This allows for a very powerful and handy manipulation of the
+       molecular system afterwards. And to give a concrete example, let's have
+       a look at translating a set of selected atoms. </para>
+       <programlisting>
+... --translate-atoms &quot;unitVectorX&quot;
+       </programlisting>
+       <para>This would use the automatically created reference 
+       &quot;unitVectorX&quot;, i.e. the vector with components (1,0,0) as
+       the translation vector for the given set of atoms. In other words, all
+       selected atoms get shifted by 1 unit (e.g. Angstr&ouml;m) in +X
+       direction.</para>
+       <para>We have the following automatically created geometry objects 
+       whose names are self-explanatory:</para>
+       <itemizedlist>
+        <listitem>zeroVector</listitem>
+        <listitem>unitVectorX</listitem>
+        <listitem>unitVectorY</listitem>
+        <listitem>unitVectorZ</listitem>
+       </itemizedlist>
+       <para>However, more vectors can be simply constructed from atomic 
+       positions, such as the position of an atom directly, the distance between 
+       two atoms (in case they are bonded, then this would be the bond vector) 
+       or from three atoms, defining a plane and giving its normal vector.
+       </para>
+       <remark>We have refrained from giving automated names to vectors and even
+       keeping them up-to-date automatically, i.e. the distance between two atoms
+       O1 and O2 could be named &quot;distance_O1_O2&quot; or similar. However, we want
+       the user to have full control and maybe come up with more suitable names 
+       such as &quot;rotation_axis&quot; in this case.</remark>
+       <warning>Note that names have to be unique and the Action will fail if
+       the name is already used.</warning>
+        <section xml:id="geometry.distance-to.vector">
+          <title xml:id="geometry.distance-to-vector.title">Atomic distance to stored vector</title>
+          <para>The distance between two selected atoms is stored as a vector as follows,</para>
+          <programlisting>
+  ... --distance-to-vector &quot;distance_vec&quot; \
+          </programlisting>
+          <para>where the distance vector can be referenced by &quot;distance_vec&quot; 
+          from then on in other Actions requiring a vector as input.</para>
+        </section>
+        <section xml:id="geometry.input-to.vector">
+          <title xml:id="geometry.input-to-vector.title">Coordinates to stored vector</title>
+          <para>We may also create a geometry vector simply by supplying the 
+          three coordinates of a vector.</para>
+          <programlisting>
+  ... --input-to-vector &quot;vector&quot; \
+      --position &quot;1,2,3&quot;
+          </programlisting>
+          <para>where the vector with components (1,2,3) can be referenced 
+          by &quot;vector&quot; .</para>
+        </section>
+        <section xml:id="geometry.plane-to.vector">
+          <title xml:id="geometry.plane-to-vector.title">Normal of plane to stored vector</title>
+          <para>Three positions in space (if they are not linear dependent)
+          define a plane in three-dimensional space.</para>
+          <para>Therefore, when exactly three atoms are selected, this Action
+          will construct the resulting plane and store its normal vector as a
+          geometry object for later reference.</para>
+          <programlisting>
+  ... --plane-to-vector &quot;planenormal&quot; \
+          </programlisting>
+          <para>where the plane's normal vector can be referenced by 
+          &quot;planenormal&quot;.</para>
+        </section>
+        <section xml:id="geometry.position-to.vector">
+          <title xml:id="geometry.position-to-vector.title">Atomic position to stored vector</title>
+          <para>Storing the position of a singly selected atom as a vector is simply done as follows,</para>
+          <programlisting>
+  ... --position-to-vector &quot;vector_O1&quot; \
+          </programlisting>
+          <para>where the vector can be referenced by &quot;vector_O1&quot; 
+          from then on.</para>
         </section>
       </section>
Index: src/Actions/GeometryAction/GeometryDistanceToVectorAction.cpp
===================================================================
--- src/Actions/GeometryAction/GeometryDistanceToVectorAction.cpp	(revision 5f869d731c0e018ae107f17a253937a99d0c6c9b)
+++ src/Actions/GeometryAction/GeometryDistanceToVectorAction.cpp	(revision 5f869d731c0e018ae107f17a253937a99d0c6c9b)
@@ -0,0 +1,107 @@
+/*
+ * Project: MoleCuilder
+ * Description: creates and alters molecular systems
+ * Copyright (C)  2017 Frederik Heber. All rights reserved.
+ * 
+ *
+ *   This file is part of MoleCuilder.
+ *
+ *    MoleCuilder is free software: you can redistribute it and/or modify
+ *    it under the terms of the GNU General Public License as published by
+ *    the Free Software Foundation, either version 2 of the License, or
+ *    (at your option) any later version.
+ *
+ *    MoleCuilder is distributed in the hope that it will be useful,
+ *    but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *    GNU General Public License for more details.
+ *
+ *    You should have received a copy of the GNU General Public License
+ *    along with MoleCuilder.  If not, see <http://www.gnu.org/licenses/>.
+ */
+
+/*
+ * GeometryDistanceToVectorAction.cpp
+ *
+ *  Created on: Mar 28, 2017
+ *      Author: heber
+ */
+
+// include config.h
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+//#include "CodePatterns/MemDebug.hpp"
+
+#include "CodePatterns/Assert.hpp"
+#include "CodePatterns/Log.hpp"
+
+#include <string>
+
+#include "Atom/atom.hpp"
+#include "Geometry/GeometryObject.hpp"
+#include "Geometry/GeometryRegistry.hpp"
+#include "World.hpp"
+
+#include "Actions/GeometryAction/GeometryDistanceToVectorAction.hpp"
+
+using namespace MoleCuilder;
+
+// and construct the stuff
+#include "../GeometryAction/GeometryDistanceToVectorAction.def"
+#include "Action_impl_pre.hpp"
+/** =========== define the function ====================== */
+ActionState::ptr GeometryDistanceToVectorAction::performCall() {
+  // check preconditions
+  World& world = World::getInstance();
+  if (world.countSelectedAtoms() != 2) {
+    STATUS("There must be exactly two atoms selected for GeometryAction DistanceToVector.");
+    return Action::failure;
+  }
+  if (GeometryRegistry::getInstance().isPresentByName(params.name.get())) {
+    STATUS("Name "+params.name.get()+" already present in registry.");
+    return Action::failure;
+  }
+
+  World::AtomSelectionIterator iter = world.beginAtomSelection();
+  const atom * const Walker = (iter++)->second;
+  const atom * const OtherWalker = (iter++)->second;
+  ASSERT( iter == world.endAtomSelection(),
+      "GeometryDistanceToVectorAction::performCall() - selection iter not at end?");
+  const Vector distance = (Walker->getPosition() - OtherWalker->getPosition())
+      * (params.reverse.get() ? -1. : 1.);
+  const GeometryObject vec(distance, params.name.get());
+  LOG(4, "DEBUG: Adding geometry object " << vec << " with norm " << distance.Norm());
+  GeometryRegistry::getInstance().addGeometry(vec);
+
+  GeometryDistanceToVectorState *UndoState = new GeometryDistanceToVectorState(distance, params);
+  return ActionState::ptr(UndoState);
+}
+
+ActionState::ptr GeometryDistanceToVectorAction::performUndo(ActionState::ptr _state) {
+//  GeometryDistanceToVectorState *state = assert_cast<GeometryDistanceToVectorState*>(_state.get());
+
+  GeometryRegistry::getInstance().removeGeometry(params.name.get());
+
+  return ActionState::ptr(_state);
+}
+
+ActionState::ptr GeometryDistanceToVectorAction::performRedo(ActionState::ptr _state){
+  GeometryDistanceToVectorState *state = assert_cast<GeometryDistanceToVectorState*>(_state.get());
+
+  const GeometryObject vec(state->distance, params.name.get());
+  LOG(4, "DEBUG: Adding geometry object " << vec);
+  GeometryRegistry::getInstance().addGeometry(vec);
+
+  return ActionState::ptr(_state);
+}
+
+bool GeometryDistanceToVectorAction::canUndo() {
+  return true;
+}
+
+bool GeometryDistanceToVectorAction::shouldUndo() {
+  return true;
+}
+/** =========== end of function ====================== */
Index: src/Actions/GeometryAction/GeometryDistanceToVectorAction.def
===================================================================
--- src/Actions/GeometryAction/GeometryDistanceToVectorAction.def	(revision 5f869d731c0e018ae107f17a253937a99d0c6c9b)
+++ src/Actions/GeometryAction/GeometryDistanceToVectorAction.def	(revision 5f869d731c0e018ae107f17a253937a99d0c6c9b)
@@ -0,0 +1,36 @@
+/*
+ * GeometryDistanceToVectorAction.cpp
+ *
+ *  Created on: Mar 28, 2017
+ *      Author: heber
+ */
+
+// all includes and forward declarations necessary for non-integral types below
+#include "Parameters/Validators/Specific/GeometryNameValidator.hpp"
+
+// i.e. there is an integer with variable name Z that can be found in
+// ValueStorage by the token "Z" -> first column: int, Z, "Z"
+// "undefine" if no parameters are required, use (NOPARAM_DEFAULT) for each (undefined) default value
+//#define paramtypes (const element *)(BoxVector) TODO: use a validator
+#define paramtypes (std::string)(bool)
+#define paramtokens ("distance-to-vector")("reverse")
+#define paramdescriptions ("name for geometry object for reference as vector")("whether to invert the resulting vector") 
+#define paramreferences (name)(reverse)
+#define paramdefaults (NOPARAM_DEFAULT())(PARAM_DEFAULT(0))
+#define paramvalids \
+(GeometryNameValidator()) \
+(DummyValidator<bool>())
+
+#define statetypes (Vector)
+#define statereferences (distance)
+
+// some defines for all the names, you may use ACTION, STATE and PARAMS
+#define CATEGORY Geometry
+#define MENUNAME "geometry"
+#define MENUPOSITION 1
+#define ACTIONNAME DistanceToVector
+#define TOKEN "distance-to-vector"
+
+// finally the information stored in the ActionTrait specialization
+#define DESCRIPTION "stores the distance vector between two selected atom as a named geometry object"
+#undef SHORTFORM
Index: src/Actions/GeometryAction/GeometryDistanceToVectorAction.hpp
===================================================================
--- src/Actions/GeometryAction/GeometryDistanceToVectorAction.hpp	(revision 5f869d731c0e018ae107f17a253937a99d0c6c9b)
+++ src/Actions/GeometryAction/GeometryDistanceToVectorAction.hpp	(revision 5f869d731c0e018ae107f17a253937a99d0c6c9b)
@@ -0,0 +1,22 @@
+/*
+ * GeometryDistanceToVectorAction.hpp
+ *
+ *  Created on: Mar 28, 2017
+ *      Author: heber
+ */
+
+#ifndef GEOMETRYDISTANCETOVECTORACTION_HPP_
+#define GEOMETRYDISTANCETOVECTORACTION_HPP_
+
+// include config.h
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+
+#include "Actions/Action.hpp"
+
+#include "../GeometryAction/GeometryDistanceToVectorAction.def"
+#include "Action_impl_header.hpp"
+
+#endif /* GEOMETRYDISTANCETOVECTORACTION_HPP_ */
Index: src/Actions/GeometryAction/GeometryInputToVectorAction.cpp
===================================================================
--- src/Actions/GeometryAction/GeometryInputToVectorAction.cpp	(revision 5f869d731c0e018ae107f17a253937a99d0c6c9b)
+++ src/Actions/GeometryAction/GeometryInputToVectorAction.cpp	(revision 5f869d731c0e018ae107f17a253937a99d0c6c9b)
@@ -0,0 +1,91 @@
+/*
+ * Project: MoleCuilder
+ * Description: creates and alters molecular systems
+ * Copyright (C)  2017 Frederik Heber. All rights reserved.
+ * 
+ *
+ *   This file is part of MoleCuilder.
+ *
+ *    MoleCuilder is free software: you can redistribute it and/or modify
+ *    it under the terms of the GNU General Public License as published by
+ *    the Free Software Foundation, either version 2 of the License, or
+ *    (at your option) any later version.
+ *
+ *    MoleCuilder is distributed in the hope that it will be useful,
+ *    but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *    GNU General Public License for more details.
+ *
+ *    You should have received a copy of the GNU General Public License
+ *    along with MoleCuilder.  If not, see <http://www.gnu.org/licenses/>.
+ */
+
+/*
+ * GeometryInputToVectorAction.cpp
+ *
+ *  Created on: Mar 28, 2017
+ *      Author: heber
+ */
+
+// include config.h
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+//#include "CodePatterns/MemDebug.hpp"
+
+#include "CodePatterns/Log.hpp"
+
+#include <string>
+
+#include "Geometry/GeometryObject.hpp"
+#include "Geometry/GeometryRegistry.hpp"
+
+#include "Actions/GeometryAction/GeometryInputToVectorAction.hpp"
+
+using namespace MoleCuilder;
+
+// and construct the stuff
+#include "../GeometryAction/GeometryInputToVectorAction.def"
+#include "Action_impl_pre.hpp"
+/** =========== define the function ====================== */
+ActionState::ptr GeometryInputToVectorAction::performCall() {
+  // check preconditions
+  if (GeometryRegistry::getInstance().isPresentByName(params.name.get())) {
+    STATUS("Name "+params.name.get()+" already present in registry.");
+    return Action::failure;
+  }
+
+  const GeometryObject vec(params.vec.get(), params.name.get());
+  LOG(4, "DEBUG: Adding geometry object " << vec << " with norm " << params.vec.get().Norm());
+  GeometryRegistry::getInstance().addGeometry(vec);
+
+  return Action::success;
+}
+
+ActionState::ptr GeometryInputToVectorAction::performUndo(ActionState::ptr _state) {
+//  GeometryInputToVectorState *state = assert_cast<GeometryInputToVectorState*>(_state.get());
+
+  GeometryRegistry::getInstance().removeGeometry(params.name.get());
+
+  return Action::success;
+}
+
+ActionState::ptr GeometryInputToVectorAction::performRedo(ActionState::ptr _state){
+//  GeometryInputToVectorState *state = assert_cast<GeometryInputToVectorState*>(_state.get());
+
+  const GeometryObject vec(params.vec.get(), params.name.get());
+  LOG(4, "DEBUG: Adding geometry object " << vec);
+  GeometryRegistry::getInstance().addGeometry(vec);
+
+  return Action::success;
+}
+
+bool GeometryInputToVectorAction::canUndo() {
+  return true;
+}
+
+bool GeometryInputToVectorAction::shouldUndo() {
+  return true;
+}
+/** =========== end of function ====================== */
Index: src/Actions/GeometryAction/GeometryInputToVectorAction.def
===================================================================
--- src/Actions/GeometryAction/GeometryInputToVectorAction.def	(revision 5f869d731c0e018ae107f17a253937a99d0c6c9b)
+++ src/Actions/GeometryAction/GeometryInputToVectorAction.def	(revision 5f869d731c0e018ae107f17a253937a99d0c6c9b)
@@ -0,0 +1,37 @@
+/*
+ * GeometryInputToVectorAction.cpp
+ *
+ *  Created on: Mar 28, 2017
+ *      Author: heber
+ */
+
+// all includes and forward declarations necessary for non-integral types below
+#include "Parameters/Validators/Specific/GeometryNameValidator.hpp"
+#include "Parameters/Validators/DummyValidator.hpp"
+
+// i.e. there is an integer with variable name Z that can be found in
+// ValueStorage by the token "Z" -> first column: int, Z, "Z"
+// "undefine" if no parameters are required, use (NOPARAM_DEFAULT) for each (undefined) default value
+//#define paramtypes (const element *)(BoxVector) TODO: use a validator
+#define paramtypes (std::string)(Vector)
+#define paramtokens ("input-to-vector")("coordinates")
+#define paramdescriptions ("name for geometry object for reference as vector")("vector coordinates") 
+#define paramreferences (name)(vec)
+#define paramdefaults (NOPARAM_DEFAULT())(NOPARAM_DEFAULT())
+#define paramvalids \
+(GeometryNameValidator()) \
+(DummyValidator<Vector>())
+
+#undef statetypes
+#undef statereferences
+
+// some defines for all the names, you may use ACTION, STATE and PARAMS
+#define CATEGORY Geometry
+#define MENUNAME "geometry"
+#define MENUPOSITION 1
+#define ACTIONNAME InputToVector
+#define TOKEN "input-to-vector"
+
+// finally the information stored in the ActionTrait specialization
+#define DESCRIPTION "stores the given vector as a named geometry object"
+#undef SHORTFORM
Index: src/Actions/GeometryAction/GeometryInputToVectorAction.hpp
===================================================================
--- src/Actions/GeometryAction/GeometryInputToVectorAction.hpp	(revision 5f869d731c0e018ae107f17a253937a99d0c6c9b)
+++ src/Actions/GeometryAction/GeometryInputToVectorAction.hpp	(revision 5f869d731c0e018ae107f17a253937a99d0c6c9b)
@@ -0,0 +1,22 @@
+/*
+ * GeometryInputToVectorAction.hpp
+ *
+ *  Created on: Mar 28, 2017
+ *      Author: heber
+ */
+
+#ifndef GEOMETRYINPUTTOVECTORACTION_HPP_
+#define GEOMETRYINPUTTOVECTORACTION_HPP_
+
+// include config.h
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+
+#include "Actions/Action.hpp"
+
+#include "../GeometryAction/GeometryInputToVectorAction.def"
+#include "Action_impl_header.hpp"
+
+#endif /* GEOMETRYINPUTTOVECTORACTION_HPP_ */
Index: src/Actions/GeometryAction/GeometryPlaneToVectorAction.cpp
===================================================================
--- src/Actions/GeometryAction/GeometryPlaneToVectorAction.cpp	(revision 5f869d731c0e018ae107f17a253937a99d0c6c9b)
+++ src/Actions/GeometryAction/GeometryPlaneToVectorAction.cpp	(revision 5f869d731c0e018ae107f17a253937a99d0c6c9b)
@@ -0,0 +1,116 @@
+/*
+ * Project: MoleCuilder
+ * Description: creates and alters molecular systems
+ * Copyright (C)  2017 Frederik Heber. All rights reserved.
+ * 
+ *
+ *   This file is part of MoleCuilder.
+ *
+ *    MoleCuilder is free software: you can redistribute it and/or modify
+ *    it under the terms of the GNU General Public License as published by
+ *    the Free Software Foundation, either version 2 of the License, or
+ *    (at your option) any later version.
+ *
+ *    MoleCuilder is distributed in the hope that it will be useful,
+ *    but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *    GNU General Public License for more details.
+ *
+ *    You should have received a copy of the GNU General Public License
+ *    along with MoleCuilder.  If not, see <http://www.gnu.org/licenses/>.
+ */
+
+/*
+ * GeometryPlaneToVectorAction.cpp
+ *
+ *  Created on: Mar 28, 2017
+ *      Author: heber
+ */
+
+// include config.h
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+//#include "CodePatterns/MemDebug.hpp"
+
+#include "CodePatterns/Log.hpp"
+
+#include <string>
+
+#include "LinearAlgebra/Plane.hpp"
+
+#include "Atom/atom.hpp"
+#include "Geometry/GeometryObject.hpp"
+#include "Geometry/GeometryRegistry.hpp"
+#include "World.hpp"
+
+#include "Actions/GeometryAction/GeometryPlaneToVectorAction.hpp"
+
+using namespace MoleCuilder;
+
+// and construct the stuff
+#include "../GeometryAction/GeometryPlaneToVectorAction.def"
+#include "Action_impl_pre.hpp"
+/** =========== define the function ====================== */
+ActionState::ptr GeometryPlaneToVectorAction::performCall() {
+  // check preconditions
+  World& world = World::getInstance();
+  if (world.countSelectedAtoms() != 3) {
+    STATUS("There must be exactly three atoms selected for GeometryAction PlaneToVector.");
+    return Action::failure;
+  }
+  if (GeometryRegistry::getInstance().isPresentByName(params.name.get())) {
+    STATUS("Name "+params.name.get()+" already present in registry.");
+    return Action::failure;
+  }
+
+  World::AtomSelectionIterator iter = world.beginAtomSelection();
+  const atom * const Walker = (iter++)->second;
+  const atom * const OtherWalker = (iter++)->second;
+  const atom * const AnotherWalker = (iter++)->second;
+  ASSERT( iter == world.endAtomSelection(),
+      "GeometryDistanceToVectorAction::performCall() - selection iter not at end?");
+  Vector PlaneNormal;
+  try {
+    const Plane AtomPlane(Walker->getPosition(), OtherWalker->getPosition(), AnotherWalker->getPosition());
+    PlaneNormal = AtomPlane.getNormal();
+  } catch (LinearDependenceException &e) {
+    ELOG(2, "The selected atomic positions are linearly dependent.");
+    return Action::failure;
+  }
+  PlaneNormal *= (params.reverse.get() ? -1. : 1.);
+  const GeometryObject vec(PlaneNormal, params.name.get());
+  LOG(4, "DEBUG: Adding geometry object " << vec << " with norm " << PlaneNormal.Norm());
+  GeometryRegistry::getInstance().addGeometry(vec);
+
+  GeometryPlaneToVectorState *UndoState = new GeometryPlaneToVectorState(PlaneNormal, params);
+  return ActionState::ptr(UndoState);
+}
+
+ActionState::ptr GeometryPlaneToVectorAction::performUndo(ActionState::ptr _state) {
+//  GeometryPlaneToVectorState *state = assert_cast<GeometryPlaneToVectorState*>(_state.get());
+
+  GeometryRegistry::getInstance().removeGeometry(params.name.get());
+
+  return ActionState::ptr(_state);
+}
+
+ActionState::ptr GeometryPlaneToVectorAction::performRedo(ActionState::ptr _state){
+  GeometryPlaneToVectorState *state = assert_cast<GeometryPlaneToVectorState*>(_state.get());
+
+  const GeometryObject vec(state->PlaneNormal, params.name.get());
+  LOG(4, "DEBUG: Adding geometry object " << vec);
+  GeometryRegistry::getInstance().addGeometry(vec);
+
+  return ActionState::ptr(_state);
+}
+
+bool GeometryPlaneToVectorAction::canUndo() {
+  return true;
+}
+
+bool GeometryPlaneToVectorAction::shouldUndo() {
+  return true;
+}
+/** =========== end of function ====================== */
Index: src/Actions/GeometryAction/GeometryPlaneToVectorAction.def
===================================================================
--- src/Actions/GeometryAction/GeometryPlaneToVectorAction.def	(revision 5f869d731c0e018ae107f17a253937a99d0c6c9b)
+++ src/Actions/GeometryAction/GeometryPlaneToVectorAction.def	(revision 5f869d731c0e018ae107f17a253937a99d0c6c9b)
@@ -0,0 +1,36 @@
+/*
+ * GeometryPlaneToVectorAction.cpp
+ *
+ *  Created on: Mar 28, 2017
+ *      Author: heber
+ */
+
+// all includes and forward declarations necessary for non-integral types below
+#include "Parameters/Validators/Specific/GeometryNameValidator.hpp"
+
+// i.e. there is an integer with variable name Z that can be found in
+// ValueStorage by the token "Z" -> first column: int, Z, "Z"
+// "undefine" if no parameters are required, use (NOPARAM_DEFAULT) for each (undefined) default value
+//#define paramtypes (const element *)(BoxVector) TODO: use a validator
+#define paramtypes (std::string)(bool)
+#define paramtokens ("plane-to-vector")("reverse")
+#define paramdescriptions ("name for geometry object for reference as vector")("whether to invert the resulting vector") 
+#define paramreferences (name)(reverse)
+#define paramdefaults (NOPARAM_DEFAULT())(PARAM_DEFAULT(0))
+#define paramvalids \
+(GeometryNameValidator()) \
+(DummyValidator<bool>())
+
+#define statetypes (Vector)
+#define statereferences (PlaneNormal)
+
+// some defines for all the names, you may use ACTION, STATE and PARAMS
+#define CATEGORY Geometry
+#define MENUNAME "geometry"
+#define MENUPOSITION 3
+#define ACTIONNAME PlaneToVector
+#define TOKEN "plane-to-vector"
+
+// finally the information stored in the ActionTrait specialization
+#define DESCRIPTION "stores the plane defined by three selected atom as a named geometry object"
+#undef SHORTFORM
Index: src/Actions/GeometryAction/GeometryPlaneToVectorAction.hpp
===================================================================
--- src/Actions/GeometryAction/GeometryPlaneToVectorAction.hpp	(revision 5f869d731c0e018ae107f17a253937a99d0c6c9b)
+++ src/Actions/GeometryAction/GeometryPlaneToVectorAction.hpp	(revision 5f869d731c0e018ae107f17a253937a99d0c6c9b)
@@ -0,0 +1,22 @@
+/*
+ * GeometryPlaneToVectorAction.hpp
+ *
+ *  Created on: Mar 28, 2017
+ *      Author: heber
+ */
+
+#ifndef GEOMETRYPLANETOVECTORACTION_HPP_
+#define GEOMETRYPLANETOVECTORACTION_HPP_
+
+// include config.h
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+
+#include "Actions/Action.hpp"
+
+#include "../GeometryAction/GeometryPlaneToVectorAction.def"
+#include "Action_impl_header.hpp"
+
+#endif /* GEOMETRYPLANETOVECTORACTION_HPP_ */
Index: src/Actions/GeometryAction/GeometryPositionToVectorAction.cpp
===================================================================
--- src/Actions/GeometryAction/GeometryPositionToVectorAction.cpp	(revision 5f869d731c0e018ae107f17a253937a99d0c6c9b)
+++ src/Actions/GeometryAction/GeometryPositionToVectorAction.cpp	(revision 5f869d731c0e018ae107f17a253937a99d0c6c9b)
@@ -0,0 +1,101 @@
+/*
+ * Project: MoleCuilder
+ * Description: creates and alters molecular systems
+ * Copyright (C)  2017 Frederik Heber. All rights reserved.
+ * 
+ *
+ *   This file is part of MoleCuilder.
+ *
+ *    MoleCuilder is free software: you can redistribute it and/or modify
+ *    it under the terms of the GNU General Public License as published by
+ *    the Free Software Foundation, either version 2 of the License, or
+ *    (at your option) any later version.
+ *
+ *    MoleCuilder is distributed in the hope that it will be useful,
+ *    but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *    GNU General Public License for more details.
+ *
+ *    You should have received a copy of the GNU General Public License
+ *    along with MoleCuilder.  If not, see <http://www.gnu.org/licenses/>.
+ */
+
+/*
+ * GeometryPositionToVectorAction.cpp
+ *
+ *  Created on: Mar 27, 2017
+ *      Author: heber
+ */
+
+// include config.h
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+//#include "CodePatterns/MemDebug.hpp"
+
+#include "CodePatterns/Log.hpp"
+
+#include <string>
+
+#include "Atom/atom.hpp"
+#include "Geometry/GeometryObject.hpp"
+#include "Geometry/GeometryRegistry.hpp"
+#include "World.hpp"
+
+#include "Actions/GeometryAction/GeometryPositionToVectorAction.hpp"
+
+using namespace MoleCuilder;
+
+// and construct the stuff
+#include "../GeometryAction/GeometryPositionToVectorAction.def"
+#include "Action_impl_pre.hpp"
+/** =========== define the function ====================== */
+ActionState::ptr GeometryPositionToVectorAction::performCall() {
+  // check preconditions
+  World& world = World::getInstance();
+  if (world.countSelectedAtoms() != 1) {
+    STATUS("There must be exactly one atom selected for GeometryAction PositionToVector.");
+    return Action::failure;
+  }
+  if (GeometryRegistry::getInstance().isPresentByName(params.name.get())) {
+    STATUS("Name "+params.name.get()+" already present in registry.");
+    return Action::failure;
+  }
+
+  const atom * const Walker = world.beginAtomSelection()->second;
+  const Vector position = Walker->getPosition();
+  const GeometryObject vec(position, params.name.get());
+  LOG(4, "DEBUG: Adding geometry object " << vec << " with norm " << position.Norm());
+  GeometryRegistry::getInstance().addGeometry(vec);
+
+  GeometryPositionToVectorState *UndoState = new GeometryPositionToVectorState(position, params);
+  return ActionState::ptr(UndoState);
+}
+
+ActionState::ptr GeometryPositionToVectorAction::performUndo(ActionState::ptr _state) {
+//  GeometryPositionToVectorState *state = assert_cast<GeometryPositionToVectorState*>(_state.get());
+
+  GeometryRegistry::getInstance().removeGeometry(params.name.get());
+
+  return ActionState::ptr(_state);
+}
+
+ActionState::ptr GeometryPositionToVectorAction::performRedo(ActionState::ptr _state){
+  GeometryPositionToVectorState *state = assert_cast<GeometryPositionToVectorState*>(_state.get());
+
+  const GeometryObject vec(state->position, params.name.get());
+  LOG(4, "DEBUG: Adding geometry object " << vec);
+  GeometryRegistry::getInstance().addGeometry(vec);
+
+  return ActionState::ptr(_state);
+}
+
+bool GeometryPositionToVectorAction::canUndo() {
+  return true;
+}
+
+bool GeometryPositionToVectorAction::shouldUndo() {
+  return true;
+}
+/** =========== end of function ====================== */
Index: src/Actions/GeometryAction/GeometryPositionToVectorAction.def
===================================================================
--- src/Actions/GeometryAction/GeometryPositionToVectorAction.def	(revision 5f869d731c0e018ae107f17a253937a99d0c6c9b)
+++ src/Actions/GeometryAction/GeometryPositionToVectorAction.def	(revision 5f869d731c0e018ae107f17a253937a99d0c6c9b)
@@ -0,0 +1,35 @@
+/*
+ * GeometryPositionToVectorAction.cpp
+ *
+ *  Created on: Mar 27, 2017
+ *      Author: heber
+ */
+
+// all includes and forward declarations necessary for non-integral types below
+#include "Parameters/Validators/Specific/GeometryNameValidator.hpp"
+
+// i.e. there is an integer with variable name Z that can be found in
+// ValueStorage by the token "Z" -> first column: int, Z, "Z"
+// "undefine" if no parameters are required, use (NOPARAM_DEFAULT) for each (undefined) default value
+//#define paramtypes (const element *)(BoxVector) TODO: use a validator
+#define paramtypes (std::string)
+#define paramtokens ("position-to-vector")
+#define paramdescriptions ("name for geometry object for reference as vector") 
+#define paramreferences (name)
+#define paramdefaults (NOPARAM_DEFAULT())
+#define paramvalids \
+(GeometryNameValidator())
+
+#define statetypes (Vector)
+#define statereferences (position)
+
+// some defines for all the names, you may use ACTION, STATE and PARAMS
+#define CATEGORY Geometry
+#define MENUNAME "geometry"
+#define MENUPOSITION 1
+#define ACTIONNAME PositionToVector
+#define TOKEN "position-to-vector"
+
+// finally the information stored in the ActionTrait specialization
+#define DESCRIPTION "stores the position of the selected atom as a named geometry object"
+#undef SHORTFORM
Index: src/Actions/GeometryAction/GeometryPositionToVectorAction.hpp
===================================================================
--- src/Actions/GeometryAction/GeometryPositionToVectorAction.hpp	(revision 5f869d731c0e018ae107f17a253937a99d0c6c9b)
+++ src/Actions/GeometryAction/GeometryPositionToVectorAction.hpp	(revision 5f869d731c0e018ae107f17a253937a99d0c6c9b)
@@ -0,0 +1,22 @@
+/*
+ * GeometryPositionToVectorAction.hpp
+ *
+ *  Created on: Mar 27, 2017
+ *      Author: heber
+ */
+
+#ifndef GEOMETRYPOSITIONTOVECTORACTION_HPP_
+#define GEOMETRYPOSITIONTOVECTORACTION_HPP_
+
+// include config.h
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+
+#include "Actions/Action.hpp"
+
+#include "../GeometryAction/GeometryPositionToVectorAction.def"
+#include "Action_impl_header.hpp"
+
+#endif /* GEOMETRYPOSITIONTOVECTORACTION_HPP_ */
Index: src/Actions/GlobalListOfActions.hpp
===================================================================
--- src/Actions/GlobalListOfActions.hpp	(revision af78afe6d51863cb0db3ce69045752ab4f7668df)
+++ src/Actions/GlobalListOfActions.hpp	(revision 5f869d731c0e018ae107f17a253937a99d0c6c9b)
@@ -69,4 +69,8 @@
   (FragmentationStoreSaturatedFragment) \
   (FragmentationStructuralOptimization) \
+  (GeometryDistanceToVector) \
+  (GeometryInputToVector) \
+  (GeometryPlaneToVector) \
+  (GeometryPositionToVector) \
   (GraphUpdateMolecules) \
   (GraphCorrectBondDegree) \
Index: src/Actions/Makefile.am
===================================================================
--- src/Actions/Makefile.am	(revision af78afe6d51863cb0db3ce69045752ab4f7668df)
+++ src/Actions/Makefile.am	(revision 5f869d731c0e018ae107f17a253937a99d0c6c9b)
@@ -64,4 +64,5 @@
   ${FILLACTIONSOURCE} \
   ${FRAGMENTATIONACTIONSOURCE} \
+  ${GEOMETRYACTIONSOURCE} \
   ${GRAPHACTIONSOURCE} \
   ${MOLECULEACTIONSOURCE} \
@@ -84,4 +85,5 @@
   ${FILLACTIONHEADER} \
   ${FRAGMENTATIONACTIONHEADER} \
+  ${GEOMETRYACTIONHEADER} \
   ${GRAPHACTIONHEADER} \
   ${MOLECULEACTIONHEADER} \
@@ -104,4 +106,5 @@
   ${FILLACTIONDEFS} \
   ${FRAGMENTATIONACTIONDEFS} \
+  ${GEOMETRYACTIONDEFS} \
   ${GRAPHACTIONDEFS} \
   ${MOLECULEACTIONDEFS} \
@@ -285,4 +288,20 @@
   Actions/FragmentationAction/StoreSaturatedFragmentAction.def \
   Actions/FragmentationAction/StructuralOptimizationAction.def
+
+GEOMETRYACTIONSOURCE = \
+	Actions/GeometryAction/GeometryDistanceToVectorAction.cpp \
+	Actions/GeometryAction/GeometryInputToVectorAction.cpp \
+	Actions/GeometryAction/GeometryPlaneToVectorAction.cpp \
+	Actions/GeometryAction/GeometryPositionToVectorAction.cpp
+GEOMETRYACTIONHEADER = \
+	Actions/GeometryAction/GeometryDistanceToVectorAction.hpp \
+	Actions/GeometryAction/GeometryInputToVectorAction.hpp \
+	Actions/GeometryAction/GeometryPlaneToVectorAction.hpp \
+	Actions/GeometryAction/GeometryPositionToVectorAction.hpp
+GEOMETRYACTIONDEFS = \
+	Actions/GeometryAction/GeometryDistanceToVectorAction.def \
+	Actions/GeometryAction/GeometryInputToVectorAction.def \
+	Actions/GeometryAction/GeometryPlaneToVectorAction.def \
+	Actions/GeometryAction/GeometryPositionToVectorAction.def
 
 GRAPHACTIONSOURCE = \
Index: src/UIElements/Menu/MenuDescription.cpp
===================================================================
--- src/UIElements/Menu/MenuDescription.cpp	(revision af78afe6d51863cb0db3ce69045752ab4f7668df)
+++ src/UIElements/Menu/MenuDescription.cpp	(revision 5f869d731c0e018ae107f17a253937a99d0c6c9b)
@@ -61,15 +61,16 @@
   // put each menu into its place, "" means top level
   MenuPositionMap->insert(std::make_pair("analysis",TopPosition("tools",1)));
-  MenuPositionMap->insert(std::make_pair("atom",TopPosition("edit",1)));
-  MenuPositionMap->insert(std::make_pair("bond",TopPosition("edit",2)));
+  MenuPositionMap->insert(std::make_pair("atom",TopPosition("edit",2)));
+  MenuPositionMap->insert(std::make_pair("bond",TopPosition("edit",3)));
   MenuPositionMap->insert(std::make_pair("command",TopPosition("",3)));
   MenuPositionMap->insert(std::make_pair("edit",TopPosition("",2)));
   MenuPositionMap->insert(std::make_pair("fill",TopPosition("tools",5)));
   MenuPositionMap->insert(std::make_pair("fragmentation",TopPosition("tools",3)));
+  MenuPositionMap->insert(std::make_pair("geometry",TopPosition("edit",5)));
   MenuPositionMap->insert(std::make_pair("graph",TopPosition("tools",4)));
-  MenuPositionMap->insert(std::make_pair("molecule",TopPosition("edit",3)));
+  MenuPositionMap->insert(std::make_pair("molecule",TopPosition("edit",4)));
   MenuPositionMap->insert(std::make_pair("potential",TopPosition("tools",7)));
-  MenuPositionMap->insert(std::make_pair("parser",TopPosition("edit",4)));
-  MenuPositionMap->insert(std::make_pair("selection",TopPosition("edit",5)));
+  MenuPositionMap->insert(std::make_pair("parser",TopPosition("edit",6)));
+  MenuPositionMap->insert(std::make_pair("selection",TopPosition("edit",1)));
   MenuPositionMap->insert(std::make_pair("tesselation",TopPosition("tools",2)));
   MenuPositionMap->insert(std::make_pair("shape",TopPosition("tools",6)));
@@ -85,4 +86,5 @@
   MenuDescriptionsMap->insert(std::make_pair("fill","Fill"));
   MenuDescriptionsMap->insert(std::make_pair("fragmentation","Fragmentation"));
+  MenuDescriptionsMap->insert(std::make_pair("geometry","Geometry"));
   MenuDescriptionsMap->insert(std::make_pair("graph","Graph"));
   MenuDescriptionsMap->insert(std::make_pair("molecule","Parse files into system"));
@@ -103,4 +105,5 @@
   MenuNameMap->insert(std::make_pair("fill","Fill"));
   MenuNameMap->insert(std::make_pair("fragmentation","Fragmentation"));
+  MenuNameMap->insert(std::make_pair("geometry","Geometry"));
   MenuNameMap->insert(std::make_pair("graph","Graph"));
   MenuNameMap->insert(std::make_pair("molecule","Molecules"));
Index: tests/Python/AllActions/options.dat
===================================================================
--- tests/Python/AllActions/options.dat	(revision af78afe6d51863cb0db3ce69045752ab4f7668df)
+++ tests/Python/AllActions/options.dat	(revision 5f869d731c0e018ae107f17a253937a99d0c6c9b)
@@ -44,4 +44,5 @@
 convex-envelope	"50."
 convex-file	"convexfile"
+coordinates	"1,0,0"
 copy-molecule	"0"
 count	"12"
@@ -58,4 +59,5 @@
 distance-to-molecule	"1.5"
 distance-to-molecule	"2.1"
+distance-to-vector	"named_vector"
 domain-position	"0.  0. 0."
 domain-position	"0 0 0"
@@ -92,4 +94,5 @@
 id-mapping	"1"
 input	"test.data"
+input-to-vector	"named_vector"
 inter-order	"2"
 interpolation-degree	"5"
@@ -141,4 +144,5 @@
 periodic	"0"
 plane-offset	"5."
+plane-to-vector	"named_vector"
 position	"0 0 0"
 position	"0 0 1"
@@ -150,4 +154,5 @@
 position	"7.283585982 3.275186040 3.535886037"
 position	"9.78 2.64 2.64"
+position-to-vector	"named_vector"
 potential-charges	"1 1"
 potential-type	"morse"
@@ -159,4 +164,5 @@
 repeat-box	"1 1 1"
 reset	1
+reverse	"0"
 rotate-around-origin	"180."
 rotate-around-origin	"20."
