Index: src/Fragmentation/Exporters/SaturatedBond.cpp
===================================================================
--- src/Fragmentation/Exporters/SaturatedBond.cpp	(revision bac32f93be11686cd34925f6b8ddc570e886dce7)
+++ src/Fragmentation/Exporters/SaturatedBond.cpp	(revision bac32f93be11686cd34925f6b8ddc570e886dce7)
@@ -0,0 +1,132 @@
+/*
+ * Project: MoleCuilder
+ * Description: creates and alters molecular systems
+ * Copyright (C)  2014 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/>.
+ */
+
+/*
+ * SaturatedBond.cpp
+ *
+ *  Created on: Jul 27, 2014
+ *      Author: heber
+ */
+
+// include config.h
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#include "CodePatterns/MemDebug.hpp"
+
+#include "SaturatedBond.hpp"
+
+#include "CodePatterns/Assert.hpp"
+#include "CodePatterns/Log.hpp"
+
+#include <cmath>
+#include <iostream>
+
+#include "Atom/atom.hpp"
+#include "Element/element.hpp"
+
+SaturatedBond::SaturatedBond(
+    const bond &_bond,
+    const atom& _remaining) :
+    saturated_bond(_bond),
+    saturated_atom(_remaining)
+{
+  // create bond and orthogonal vectors
+  const atom &other = *saturated_bond.GetOtherAtom(&saturated_atom);
+  BondVector = other.getPosition() - saturated_atom.getPosition();
+  BondVector.Normalize();
+  vector_a.GetOneNormalVector(BondVector);
+  vector_b = BondVector;
+  vector_b.VectorProduct(vector_a);
+
+  // gather data for this element from the tables
+  const double HydrogenDistance =
+      saturated_atom.getElement().getHBondDistance(saturated_bond.getDegree()-1);
+  ASSERT( HydrogenDistance > 0.,
+      "SaturatedBond::SaturatedBond() - negative bond distance");
+  const double HydrogenAngle =
+      saturated_atom.getElement().getHBondAngle(saturated_bond.getDegree()-1);
+  ASSERT( HydrogenAngle >= 0.,
+      "SaturatedBond::SaturatedBond() - negative bond angle");
+  LOG(5, "DEBUG: Hydrogen distance is " << HydrogenDistance
+      << ", angle is " << HydrogenAngle);
+
+  // create correct lengths
+  const double BondVectorLength = cos((HydrogenAngle/180.*M_PI)/2.)*HydrogenDistance;
+  const double OrthogonalLength = sin((HydrogenAngle/180.*M_PI)/2.)*HydrogenDistance;
+  BondVector *= BondVectorLength;
+  vector_a *= OrthogonalLength;
+  vector_b *= OrthogonalLength;
+
+  LOG(5, "DEBUG: BondVector is " << BondVector
+      << ", vector_a is " << vector_a
+      << ", and vector_b is " << vector_b);
+}
+
+std::vector<Vector> SaturatedBond::getPositions() const
+{
+  std::vector<Vector> positions;
+  positions.reserve(saturated_bond.getDegree());
+
+  // return positions with respect to the bond degree
+  switch (saturated_bond.getDegree())
+  {
+    case 1:
+      {
+        positions.push_back(BondVector);
+      }
+      break;
+    case 2:
+      {
+        const Vector position_a = cos(alpha) * vector_a + sin(alpha) * vector_b;
+        const Vector position_b = cos(alpha+M_PI) * vector_a + sin(alpha+M_PI) * vector_b;
+        positions.push_back(BondVector + position_a);
+        positions.push_back(BondVector + position_b);
+      }
+      break;
+    case 3:
+      {
+        const Vector position_a =
+            cos(alpha) * vector_a + sin(alpha) * vector_b;
+        const Vector position_b =
+            cos(alpha+2.*M_PI/3.) * vector_a + sin(alpha+2.*M_PI/3.) * vector_b;
+        const Vector position_c =
+            cos(alpha+4.*M_PI/3.) * vector_a + sin(alpha+4.*M_PI/3.) * vector_b;
+        positions.push_back(BondVector + position_a);
+        positions.push_back(BondVector + position_b);
+        positions.push_back(BondVector + position_c);
+      }
+      break;
+    default:
+      ASSERT(0, "SaturatedBond::getPositions() - we cannot deal with bond degree "
+          +toString(saturated_bond.getDegree())+" of bond "+toString(saturated_bond));
+  }
+
+  return positions;
+}
+
+std::ostream &operator<<(std::ostream &ost, const SaturatedBond& _bond)
+{
+  ost << _bond.saturated_bond;
+  return ost;
+}
Index: src/Fragmentation/Exporters/SaturatedBond.hpp
===================================================================
--- src/Fragmentation/Exporters/SaturatedBond.hpp	(revision bac32f93be11686cd34925f6b8ddc570e886dce7)
+++ src/Fragmentation/Exporters/SaturatedBond.hpp	(revision bac32f93be11686cd34925f6b8ddc570e886dce7)
@@ -0,0 +1,89 @@
+/*
+ * SaturatedBond.hpp
+ *
+ *  Created on: Jul 27, 2014
+ *      Author: heber
+ */
+
+#ifndef SATURATEDBOND_HPP_
+#define SATURATEDBOND_HPP_
+
+// include config.h
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#include <vector>
+#include <iosfwd>
+#include <boost/shared_ptr.hpp>
+
+#include "LinearAlgebra/Vector.hpp"
+
+#include "Bond/bond.hpp"
+
+class SaturationDistanceMaximizer;
+class SaturatedBond;
+
+std::ostream &operator<<(std::ostream &ost, const SaturatedBond& _bond);
+
+/** This class contains a dangling bond and information how to saturate it
+ * with hydrogens.
+ *
+ * Hydrogens are place on a cylinder on the sphere around the remaining atom.
+ * The angle \a alpha describes the position along the circle cutting the
+ * sphere. The symmetry axis of the cylinder is the bond direction. The
+ * orthogonal vectors \a vector_a and \a vector_b describe the circle on the
+ * sphere.
+ */
+class SaturatedBond
+{
+  //!> allow output operator const access to private parts
+  friend std::ostream &operator<<(std::ostream &ost, const SaturatedBond& _bond);
+
+public:
+  //!> typedef for a shared pointer of this class
+  typedef boost::shared_ptr<SaturatedBond> ptr;
+
+  /** Cstor of class SaturatedBond, requires a present \a _bond.
+   *
+   * \param _bond bond to saturate
+   * \param _remaining atom that is not cut off
+   */
+  SaturatedBond(const bond &_bond, const atom& _remaining);
+
+  /** Dstor of SaturatedBond.
+   *
+   */
+  ~SaturatedBond() {}
+
+  //!> typedef for a vector of Vectors
+  typedef std::vector<Vector> positions_t;
+
+  /** calculates positions where to place hydrogens to saturate this bond.
+   *
+   * \note Positions are always relative to \a saturated, i.e. to the atom
+   * that is saturated.
+   */
+  positions_t getPositions() const;
+
+private:
+  //!> SaturationDistanceMinimizer needs access to alpha and directional vectors
+  friend class SaturationDistanceMaximizer;
+
+  //!> bond to saturate
+  const bond& saturated_bond;
+  //!> central atom which is saturated
+  const atom& saturated_atom;
+  //!> rotation angle describing position.
+  double alpha;
+  //!> Vector along the bond
+  Vector BondVector;
+  //!> first vector orthogonal to \a _bond
+  Vector vector_a;
+  //!> second vector orthogonal to \a _bond
+  Vector vector_b;
+};
+
+
+
+#endif /* SATURATEDBOND_HPP_ */
Index: src/Fragmentation/Makefile.am
===================================================================
--- src/Fragmentation/Makefile.am	(revision a8f1d258e9e7fda6f62cbc12bf57a09cb5102256)
+++ src/Fragmentation/Makefile.am	(revision bac32f93be11686cd34925f6b8ddc570e886dce7)
@@ -7,4 +7,5 @@
 	Fragmentation/Exporters/ExportGraph.cpp \
 	Fragmentation/Exporters/HydrogenPool.cpp \
+	Fragmentation/Exporters/SaturatedBond.cpp \
 	Fragmentation/Exporters/SaturatedFragment.cpp \
 	Fragmentation/Homology/FragmentEdge.cpp \
@@ -33,4 +34,5 @@
 	Fragmentation/Exporters/ExportGraph.hpp \
 	Fragmentation/Exporters/HydrogenPool.hpp \
+	Fragmentation/Exporters/SaturatedBond.hpp \
 	Fragmentation/Exporters/SaturatedFragment.hpp \
 	Fragmentation/Homology/FragmentEdge.hpp \
