Index: src/Actions/GlobalListOfActions.hpp
===================================================================
--- src/Actions/GlobalListOfActions.hpp	(revision a367b81f9d73ebe6fddef7c4b5acf176cbc0f459)
+++ src/Actions/GlobalListOfActions.hpp	(revision 4dc30911b17eed762fa2312657a6cead1ac5593d)
@@ -117,5 +117,6 @@
   (FragmentationFragmentation) \
   (FillRegularGrid) \
-  (FillSphericalSurface)
+  (FillSphericalSurface) \
+  (ShapeSetShape)
 
 // we need to append the automation action in case we have the JobMarket
Index: src/Actions/Makefile.am
===================================================================
--- src/Actions/Makefile.am	(revision a367b81f9d73ebe6fddef7c4b5acf176cbc0f459)
+++ src/Actions/Makefile.am	(revision 4dc30911b17eed762fa2312657a6cead1ac5593d)
@@ -60,4 +60,5 @@
   ${SELECTIONATOMACTIONSOURCE} \
   ${SELECTIONMOLECULEACTIONSOURCE} \
+  ${SHAPEACTIONSOURCE} \
   ${TESSELATIONACTIONSOURCE} \
   $(UNDOACTIONSOURCE) \
@@ -76,4 +77,5 @@
   ${SELECTIONATOMACTIONHEADER} \
   ${SELECTIONMOLECULEACTIONHEADER} \
+  ${SHAPEACTIONHEADER} \
   ${TESSELATIONACTIONHEADER} \
   $(UNDOACTIONHEADER) \
@@ -92,4 +94,5 @@
   ${SELECTIONATOMACTIONDEFS} \
   ${SELECTIONMOLECULEACTIONDEFS} \
+  ${SHAPEACTIONDEFS} \
   ${TESSELATIONACTIONDEFS} \
   $(UNDOACTIONDEFS) \
@@ -399,7 +402,14 @@
   Actions/SelectionAction/Molecules/NotMoleculeOfAtomAction.def
 	
+SHAPEACTIONSOURCE = \
+  Actions/ShapeAction/SetShapeAction.cpp
+SHAPEACTIONHEADER = \
+  Actions/ShapeAction/SetShapeAction.hpp
+SHAPEACTIONDEFS = \
+  Actions/ShapeAction/SetShapeAction.def
+	
 TESSELATIONACTIONSOURCE = \
   Actions/TesselationAction/ConvexEnvelopeAction.cpp \
-  Actions/TesselationAction/NonConvexEnvelopeAction.cpp               
+  Actions/TesselationAction/NonConvexEnvelopeAction.cpp
 TESSELATIONACTIONHEADER = \
   Actions/TesselationAction/ConvexEnvelopeAction.hpp \
Index: src/Actions/ShapeAction/SetShapeAction.cpp
===================================================================
--- src/Actions/ShapeAction/SetShapeAction.cpp	(revision 4dc30911b17eed762fa2312657a6cead1ac5593d)
+++ src/Actions/ShapeAction/SetShapeAction.cpp	(revision 4dc30911b17eed762fa2312657a6cead1ac5593d)
@@ -0,0 +1,103 @@
+/*
+ * Project: MoleCuilder
+ * Description: creates and alters molecular systems
+ * Copyright (C)  2010-2012 University of Bonn. 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/>.
+ */
+
+/*
+ * SetShapeAction.cpp
+ *
+ *  Created on: Sep 6, 2012
+ *      Author: ankele
+ */
+
+// include config.h
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#include "CodePatterns/MemDebug.hpp"
+
+#include "Shapes/ShapeFactory.hpp"
+#include "CodePatterns/Log.hpp"
+#include "CodePatterns/Verbose.hpp"
+
+#include <iostream>
+#include <string>
+
+#include "SetShapeAction.hpp"
+
+using namespace MoleCuilder;
+
+// and construct the stuff
+#include "SetShapeAction.def"
+#include "Action_impl_pre.hpp"
+/** =========== define the function ====================== */
+Action::state_ptr ShapeSetShapeAction::performCall() {
+  ShapeFactory &factory = ShapeFactory::getInstance();
+  LOG(1, "Setting shape factory to: '" << params.shape_type.get() << "'");
+
+  const std::string old_type = factory.getShapeName(factory.getType());
+  Vector old_translation = factory.getTranslation();
+  Vector old_stretch = factory.getStretch();
+  double old_angle_x = factory.getAngle()[0];
+  double old_angle_y = factory.getAngle()[1];
+  double old_angle_z = factory.getAngle()[2];
+
+  factory.setType(factory.getShapeByName(params.shape_type.get()));
+  factory.setTranslation(params.translation.get());
+  factory.setStretch(params.stretch.get());
+  factory.setAngle(params.angle_x.get(), params.angle_y.get(), params.angle_z.get());
+
+  return Action::state_ptr(new ShapeSetShapeState(old_type, old_translation, old_stretch, old_angle_x, old_angle_y, old_angle_z, params));
+}
+
+Action::state_ptr ShapeSetShapeAction::performUndo(Action::state_ptr _state) {
+  ShapeFactory &factory = ShapeFactory::getInstance();
+  ShapeSetShapeState *state = assert_cast<ShapeSetShapeState*>(_state.get());
+
+  LOG(1, "INFO: Reverting shape factory to '" << state->old_type << "'.");
+
+  factory.setType(factory.getShapeByName(state->old_type));
+  factory.setTranslation(state->old_translation);
+  factory.setStretch(state->old_stretch);
+  factory.setAngle(state->old_angle_x, state->old_angle_y, state->old_angle_z);
+
+  return Action::state_ptr(_state);
+}
+
+Action::state_ptr ShapeSetShapeAction::performRedo(Action::state_ptr _state){
+  ShapeFactory &factory = ShapeFactory::getInstance();
+
+  factory.setType(factory.getShapeByName(params.shape_type.get()));
+  factory.setTranslation(params.translation.get());
+  factory.setStretch(params.stretch.get());
+  factory.setAngle(params.angle_x.get(), params.angle_y.get(), params.angle_z.get());
+
+  return Action::state_ptr(_state);
+}
+
+bool ShapeSetShapeAction::canUndo() {
+  return true;
+}
+
+bool ShapeSetShapeAction::shouldUndo() {
+  return true;
+}
+/** =========== end of function ====================== */
Index: src/Actions/ShapeAction/SetShapeAction.def
===================================================================
--- src/Actions/ShapeAction/SetShapeAction.def	(revision 4dc30911b17eed762fa2312657a6cead1ac5593d)
+++ src/Actions/ShapeAction/SetShapeAction.def	(revision 4dc30911b17eed762fa2312657a6cead1ac5593d)
@@ -0,0 +1,43 @@
+/*
+ * SetShapeAction.def
+ *
+ *  Created on: Sep 6, 2012
+ *      Author: ankele
+ */
+
+// all includes and forward declarations necessary for non-integral types below
+#include <boost/filesystem.hpp>
+
+#include "Parameters/Validators/DummyValidator.hpp"
+#include "Parameters/Validators/Specific/VectorPositiveComponentsValidator.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 (std::string)(Vector)(Vector)(double)(double)(double)
+#define paramtokens ("shape-type")("translation")("stretch")("angle-x")("angle-y")("angle-z")
+#define paramdescriptions ("type of shape to create")("translation distance")("scaling factors")("rotation x")("rotation y")("rotation z")
+#define paramdefaults (NOPARAM_DEFAULT)(PARAM_DEFAULT(Vector(0.,0.,0.)))(PARAM_DEFAULT(Vector(1.,1.,1.)))(PARAM_DEFAULT(0.))(PARAM_DEFAULT(0.))(PARAM_DEFAULT(0.))
+#define paramreferences (shape_type)(translation)(stretch)(angle_x)(angle_y)(angle_z)
+#define paramvalids \
+(DummyValidator<std::string>()) \
+(DummyValidator<Vector>()) \
+(VectorPositiveComponentsValidator()) \
+(DummyValidator<double>()) \
+(DummyValidator<double>()) \
+(DummyValidator<double>())
+
+#define statetypes (std::string)(Vector)(Vector)(double)(double)(double)
+#define statereferences (old_type)(old_translation)(old_stretch)(old_angle_x)(old_angle_y)(old_angle_z)
+
+// some defines for all the names, you may use ACTION, STATE and PARAMS
+#define CATEGORY Shape
+#define MENUNAME "shape"
+#define MENUPOSITION 1
+#define ACTIONNAME SetShape
+#define TOKEN "set-shape"
+
+
+// finally the information stored in the ActionTrait specialization
+#define DESCRIPTION "sets the properties for the next shape to be created by the shape factory"
+#undef SHORTFORM
Index: src/Actions/ShapeAction/SetShapeAction.hpp
===================================================================
--- src/Actions/ShapeAction/SetShapeAction.hpp	(revision 4dc30911b17eed762fa2312657a6cead1ac5593d)
+++ src/Actions/ShapeAction/SetShapeAction.hpp	(revision 4dc30911b17eed762fa2312657a6cead1ac5593d)
@@ -0,0 +1,22 @@
+/*
+ * SetShapeAction.hpp
+ *
+ *  Created on: Sep 6, 2012
+ *      Author: ankele
+ */
+
+#ifndef SETSHAPEACTION_HPP_
+#define SETSHAPEACTION_HPP_
+
+// include config.h
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+
+#include "Actions/Action.hpp"
+
+#include "SetShapeAction.def"
+#include "Action_impl_header.hpp"
+
+#endif /* SETSHAPEACTION_HPP_ */
Index: src/UIElements/CommandLineUI/CommandLineParser.cpp
===================================================================
--- src/UIElements/CommandLineUI/CommandLineParser.cpp	(revision a367b81f9d73ebe6fddef7c4b5acf176cbc0f459)
+++ src/UIElements/CommandLineUI/CommandLineParser.cpp	(revision 4dc30911b17eed762fa2312657a6cead1ac5593d)
@@ -67,4 +67,5 @@
   command("Command options"),
   fill("fill options"),
+  shape("shape options"),
   fragmentation("Fragmentation options"),
   graph("Graph options"),
@@ -82,4 +83,5 @@
   CmdParserLookup["edit"] = &edit;
   CmdParserLookup["fill"] = &fill;
+  CmdParserLookup["shape"] = &shape;
   CmdParserLookup["fragmentation"] = &fragmentation;
   CmdParserLookup["graph"] = &graph;
Index: src/UIElements/CommandLineUI/CommandLineParser.hpp
===================================================================
--- src/UIElements/CommandLineUI/CommandLineParser.hpp	(revision a367b81f9d73ebe6fddef7c4b5acf176cbc0f459)
+++ src/UIElements/CommandLineUI/CommandLineParser.hpp	(revision 4dc30911b17eed762fa2312657a6cead1ac5593d)
@@ -59,4 +59,5 @@
   po::options_description edit;
   po::options_description fill;
+  po::options_description shape;
   po::options_description fragmentation;
   po::options_description graph;
Index: src/UIElements/Menu/MenuDescription.cpp
===================================================================
--- src/UIElements/Menu/MenuDescription.cpp	(revision a367b81f9d73ebe6fddef7c4b5acf176cbc0f459)
+++ src/UIElements/Menu/MenuDescription.cpp	(revision 4dc30911b17eed762fa2312657a6cead1ac5593d)
@@ -71,4 +71,5 @@
   MenuPositionMap->insert(std::make_pair("selection",TopPosition("edit",4)));
   MenuPositionMap->insert(std::make_pair("tesselation",TopPosition("tools",2)));
+  MenuPositionMap->insert(std::make_pair("shape",TopPosition("tools",6)));
   MenuPositionMap->insert(std::make_pair("tools",TopPosition("",4)));
   MenuPositionMap->insert(std::make_pair("world",TopPosition("",1)));
@@ -86,4 +87,5 @@
   MenuDescriptionsMap->insert(std::make_pair("selection","Select atoms/molecules"));
   MenuDescriptionsMap->insert(std::make_pair("tesselation","Tesselate molecules"));
+  MenuDescriptionsMap->insert(std::make_pair("shape","Edit shapes"));
   MenuDescriptionsMap->insert(std::make_pair("tools","Various tools"));
   MenuDescriptionsMap->insert(std::make_pair("world","Edit world"));
@@ -101,4 +103,5 @@
   MenuNameMap->insert(std::make_pair("selection","Selection"));
   MenuNameMap->insert(std::make_pair("tesselation","Tesselation"));
+  MenuNameMap->insert(std::make_pair("shape","Shape"));
   MenuNameMap->insert(std::make_pair("tools","Tools"));
   MenuNameMap->insert(std::make_pair("world","Globals"));
