Index: src/Actions/ShapeAction/CreateShapeAction.cpp
===================================================================
--- src/Actions/ShapeAction/CreateShapeAction.cpp	(revision 4458b09d5581fddd238a05956231b1e22bba1f56)
+++ src/Actions/ShapeAction/CreateShapeAction.cpp	(revision 4458b09d5581fddd238a05956231b1e22bba1f56)
@@ -0,0 +1,96 @@
+/*
+ * 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/>.
+ */
+
+/*
+ * CreateShapeAction.cpp
+ *
+ *  Created on: Sep 13, 2012
+ *      Author: ankele
+ */
+
+// include config.h
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#include "CodePatterns/MemDebug.hpp"
+
+#include "Shapes/ShapeFactory.hpp"
+#include "Shapes/ShapeRegistry.hpp"
+#include "CodePatterns/Log.hpp"
+#include "CodePatterns/Verbose.hpp"
+
+#include <iostream>
+#include <string>
+
+#include "CreateShapeAction.hpp"
+
+using namespace MoleCuilder;
+
+// and construct the stuff
+#include "CreateShapeAction.def"
+#include "Action_impl_pre.hpp"
+/** =========== define the function ====================== */
+Action::state_ptr ShapeCreateShapeAction::performCall() {
+  LOG(1, "Adding shape into ShapeRegistry.");
+
+  Shape s = ShapeFactory::getInstance().produce();
+  if (params.shape_name.get() != "")
+    s.setName(params.shape_name.get());
+  else
+    s.setName(ShapeRegistry::getInstance().getDefaultNameForShape(s));
+  std::string old_name = s.getName();
+  std::cout << s.getName() << "\n";
+  ShapeRegistry::getInstance().addShape(s);
+
+  return Action::state_ptr(new ShapeCreateShapeState(old_name, params));
+}
+
+Action::state_ptr ShapeCreateShapeAction::performUndo(Action::state_ptr _state) {
+  ShapeCreateShapeState *state = assert_cast<ShapeCreateShapeState*>(_state.get());
+
+  LOG(1, "INFO: Removing '" << state->old_name << "' from ShapeRegistry.");
+
+  std::cout << state->old_name << "\n";
+  ShapeRegistry::getInstance().removeShape(state->old_name);
+
+  return Action::state_ptr(_state);
+}
+
+Action::state_ptr ShapeCreateShapeAction::performRedo(Action::state_ptr _state){
+  ShapeCreateShapeState *state = assert_cast<ShapeCreateShapeState*>(_state.get());
+
+  Shape s = ShapeFactory::getInstance().produce();
+  s.setName(state->old_name);
+  ShapeRegistry::getInstance().addShape(s);
+
+  return Action::state_ptr(_state);
+}
+
+bool ShapeCreateShapeAction::canUndo() {
+  return true;
+}
+
+bool ShapeCreateShapeAction::shouldUndo() {
+  return true;
+}
+/** =========== end of function ====================== */
Index: src/Actions/ShapeAction/CreateShapeAction.def
===================================================================
--- src/Actions/ShapeAction/CreateShapeAction.def	(revision 4458b09d5581fddd238a05956231b1e22bba1f56)
+++ src/Actions/ShapeAction/CreateShapeAction.def	(revision 4458b09d5581fddd238a05956231b1e22bba1f56)
@@ -0,0 +1,38 @@
+/*
+ * CreateShapeAction.def
+ *
+ *  Created on: Sep 13, 2012
+ *      Author: ankele
+ */
+
+// all includes and forward declarations necessary for non-integral types below
+#include <boost/filesystem.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 (std::string)
+#define paramtokens ("shape-name")
+#define paramdescriptions ("name shape to create")
+#define paramdefaults (PARAM_DEFAULT(std::string("")))
+#define paramreferences (shape_name)
+#define paramvalids \
+(DummyValidator<std::string>())
+
+#define statetypes (std::string)
+#define statereferences (old_name)
+
+
+// some defines for all the names, you may use ACTION, STATE and PARAMS
+#define CATEGORY Shape
+#define MENUNAME "shape"
+#define MENUPOSITION 2
+#define ACTIONNAME CreateShape
+#define TOKEN "create-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/CreateShapeAction.hpp
===================================================================
--- src/Actions/ShapeAction/CreateShapeAction.hpp	(revision 4458b09d5581fddd238a05956231b1e22bba1f56)
+++ src/Actions/ShapeAction/CreateShapeAction.hpp	(revision 4458b09d5581fddd238a05956231b1e22bba1f56)
@@ -0,0 +1,22 @@
+/*
+ * CreateShapeAction.hpp
+ *
+ *  Created on: Sep 13, 2012
+ *      Author: ankele
+ */
+
+#ifndef CREATESHAPEACTION_HPP_
+#define CREATESHAPEACTION_HPP_
+
+// include config.h
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+
+#include "Actions/Action.hpp"
+
+#include "CreateShapeAction.def"
+#include "Action_impl_header.hpp"
+
+#endif /* CREATESHAPEACTION_HPP_ */
