Index: src/Actions/GraphAction/DestroyAdjacencyAction.cpp
===================================================================
--- src/Actions/GraphAction/DestroyAdjacencyAction.cpp	(revision 560cbfdc6f64a3ba2d8d199f06984d8ea1f79247)
+++ src/Actions/GraphAction/DestroyAdjacencyAction.cpp	(revision 560cbfdc6f64a3ba2d8d199f06984d8ea1f79247)
@@ -0,0 +1,155 @@
+/*
+ * Project: MoleCuilder
+ * Description: creates and alters molecular systems
+ * Copyright (C)  2013 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/>.
+ */
+
+/*
+ * DestroyAdjacencyAction.cpp
+ *
+ *  Created on: May 1, 2013
+ *      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 "Atom/atom.hpp"
+#include "Descriptors/AtomIdDescriptor.hpp"
+#include "Descriptors/AtomSelectionDescriptor.hpp"
+#include "Graph/BondGraph.hpp"
+#include "World.hpp"
+#include "WorldTime.hpp"
+
+#include <iostream>
+#include <list>
+#include <string>
+
+#include "Actions/GraphAction/DestroyAdjacencyAction.hpp"
+
+using namespace MoleCuilder;
+
+// Storing undo state
+struct BondInfo_t {
+  atomId_t leftatom;
+  atomId_t rightatom;
+  size_t degree;
+};
+
+// and construct the stuff
+#include "DestroyAdjacencyAction.def"
+#include "Action_impl_pre.hpp"
+/** =========== define the function ====================== */
+Action::state_ptr GraphDestroyAdjacencyAction::performCall() {
+  BondGraph *BG = World::getInstance().getBondGraph();
+  ASSERT(BG != NULL, "GraphDestroyAdjacencyAction: BondGraph is NULL.");
+
+  // check precondition
+  World::AtomComposite Set = World::getInstance().getAllAtoms(AtomsBySelection());
+  if (Set.empty()) {
+    ELOG(2, "No atoms selected.");
+    return Action::failure;
+  }
+
+  // count all present bonds
+  std::vector<BondInfo_t> bonds;
+  {
+    size_t count_bonds = 0;
+    for (World::AtomComposite::const_iterator iter = Set.begin();
+        iter != Set.end();
+        ++iter) {
+      const atom * const Walker = *iter;
+      count_bonds += Walker->getListOfBonds().size();
+    }
+    bonds.reserve(count_bonds/2);
+  }
+  // Storing undo info
+  for (World::AtomComposite::const_iterator iter = Set.begin();
+      iter != Set.end();
+      ++iter) {
+    const atom * const Walker = *iter;
+    const BondList& ListOfBonds = Walker->getListOfBonds();
+    for (BondList::const_iterator bonditer = ListOfBonds.begin();
+        bonditer != ListOfBonds.end();
+        ++bonditer) {
+      const bond::ptr &CurrentBond = *bonditer;
+      // if both atoms are in selected set, we check ids otherwise not
+      if (((!World::getInstance().isSelected(CurrentBond->leftatom))
+          || (!World::getInstance().isSelected(CurrentBond->rightatom)))
+          || (CurrentBond->leftatom->getId() < CurrentBond->rightatom->getId())) {
+        BondInfo_t BondInfo;
+        BondInfo.leftatom = CurrentBond->leftatom->getId();
+        BondInfo.rightatom = CurrentBond->rightatom->getId();
+        BondInfo.degree = CurrentBond->BondDegree;
+        bonds.push_back(BondInfo);
+      }
+    }
+  }
+  GraphDestroyAdjacencyState *UndoState = new GraphDestroyAdjacencyState(bonds, params);
+
+  LOG(0, "STATUS: Clearing the Adjacency.");
+  BG->cleanAdjacencyList(Set);
+
+  return Action::state_ptr(UndoState);
+}
+
+Action::state_ptr GraphDestroyAdjacencyAction::performUndo(Action::state_ptr _state) {
+  GraphDestroyAdjacencyState *state = assert_cast<GraphDestroyAdjacencyState*>(_state.get());
+
+  const size_t CurrentTime = WorldTime::getTime();
+  std::vector<BondInfo_t> &bonds = state->bonds;
+  for(std::vector<BondInfo_t>::const_iterator iter = bonds.begin();
+      iter != bonds.end(); ++iter) {
+    atom * const Walker = World::getInstance().getAtom(AtomById(iter->leftatom));
+    ASSERT( Walker != NULL,
+        "GraphDestroyAdjacencyAction::performUndo() - "+toString(iter->leftatom)+" missing.");
+    atom * const OtherWalker = World::getInstance().getAtom(AtomById(iter->rightatom));
+    ASSERT( OtherWalker != NULL,
+        "GraphDestroyAdjacencyAction::performUndo() - "+toString(iter->rightatom)+" missing.");
+    bond::ptr CurrentBond = Walker->addBond(CurrentTime, OtherWalker);
+    CurrentBond->BondDegree = iter->degree;
+  }
+  return Action::state_ptr(_state);
+}
+
+Action::state_ptr GraphDestroyAdjacencyAction::performRedo(Action::state_ptr _state){
+  BondGraph *BG = World::getInstance().getBondGraph();
+  ASSERT(BG != NULL, "GraphDestroyAdjacencyAction: BondGraph is NULL.");
+
+  World::AtomComposite Set = World::getInstance().getAllAtoms(AtomsBySelection());
+  BG->cleanAdjacencyList(Set);
+
+  return Action::state_ptr(_state);
+}
+
+bool GraphDestroyAdjacencyAction::canUndo() {
+  return true;
+}
+
+bool GraphDestroyAdjacencyAction::shouldUndo() {
+  return true;
+}
+/** =========== end of function ====================== */
Index: src/Actions/GraphAction/DestroyAdjacencyAction.def
===================================================================
--- src/Actions/GraphAction/DestroyAdjacencyAction.def	(revision 560cbfdc6f64a3ba2d8d199f06984d8ea1f79247)
+++ src/Actions/GraphAction/DestroyAdjacencyAction.def	(revision 560cbfdc6f64a3ba2d8d199f06984d8ea1f79247)
@@ -0,0 +1,37 @@
+/*
+ * DestroyAdjacencyAction.def
+ *
+ *  Created on: Mar 01, 2013
+ *      Author: heber
+ */
+
+// all includes and forward declarations necessary for non-integral types below
+#include <vector>
+#include "types.hpp"
+
+struct BondInfo_t;
+
+// 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
+#undef paramtypes
+#undef paramtokens
+#undef paramdescriptions
+#undef paramdefaults
+#undef paramreferences
+#undef paramvalids
+
+#define statetypes (std::vector<BondInfo_t>)
+#define statereferences (bonds)
+
+// some defines for all the names, you may use ACTION, STATE and PARAMS
+#define CATEGORY Graph
+#define MENUNAME "graph"
+#define MENUPOSITION 1
+#define ACTIONNAME DestroyAdjacency
+#define TOKEN "destroy-adjacency"
+
+
+// finally the information stored in the ActionTrait specialization
+#define DESCRIPTION "destroy the present bond graph of the selected atoms"
+#undef SHORTFORM
Index: src/Actions/GraphAction/DestroyAdjacencyAction.hpp
===================================================================
--- src/Actions/GraphAction/DestroyAdjacencyAction.hpp	(revision 560cbfdc6f64a3ba2d8d199f06984d8ea1f79247)
+++ src/Actions/GraphAction/DestroyAdjacencyAction.hpp	(revision 560cbfdc6f64a3ba2d8d199f06984d8ea1f79247)
@@ -0,0 +1,22 @@
+/*
+ * DestroyAdjacencyAction.hpp
+ *
+ *  Created on: May 1, 2013
+ *      Author: heber
+ */
+
+#ifndef DESTROYADJACENCYACTION_HPP_
+#define DESTROYADJACENCYACTION_HPP_
+
+// include config.h
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+
+#include "Actions/Action.hpp"
+
+#include "DestroyAdjacencyAction.def"
+#include "Action_impl_header.hpp"
+
+#endif /* DESTROYADJACENCYACTION_HPP_ */
