| 1 | /* | 
|---|
| 2 | * SaturatedBond.hpp | 
|---|
| 3 | * | 
|---|
| 4 | *  Created on: Jul 27, 2014 | 
|---|
| 5 | *      Author: heber | 
|---|
| 6 | */ | 
|---|
| 7 |  | 
|---|
| 8 | #ifndef SATURATEDBOND_HPP_ | 
|---|
| 9 | #define SATURATEDBOND_HPP_ | 
|---|
| 10 |  | 
|---|
| 11 | // include config.h | 
|---|
| 12 | #ifdef HAVE_CONFIG_H | 
|---|
| 13 | #include <config.h> | 
|---|
| 14 | #endif | 
|---|
| 15 |  | 
|---|
| 16 | #include <vector> | 
|---|
| 17 | #include <iosfwd> | 
|---|
| 18 | #include <boost/shared_ptr.hpp> | 
|---|
| 19 |  | 
|---|
| 20 | #include "LinearAlgebra/Vector.hpp" | 
|---|
| 21 |  | 
|---|
| 22 | #include "Bond/bond.hpp" | 
|---|
| 23 |  | 
|---|
| 24 | class SaturationDistanceMaximizer; | 
|---|
| 25 | class SaturatedBond; | 
|---|
| 26 |  | 
|---|
| 27 | std::ostream &operator<<(std::ostream &ost, const SaturatedBond& _bond); | 
|---|
| 28 |  | 
|---|
| 29 | /** This class contains a dangling bond and information how to saturate it | 
|---|
| 30 | * with hydrogens. | 
|---|
| 31 | * | 
|---|
| 32 | * Hydrogens are place on a cylinder on the sphere around the remaining atom. | 
|---|
| 33 | * The angle \a alpha describes the position along the circle cutting the | 
|---|
| 34 | * sphere. The symmetry axis of the cylinder is the bond direction. The | 
|---|
| 35 | * orthogonal vectors \a vector_a and \a vector_b describe the circle on the | 
|---|
| 36 | * sphere. | 
|---|
| 37 | */ | 
|---|
| 38 | class SaturatedBond | 
|---|
| 39 | { | 
|---|
| 40 | //!> allow output operator const access to private parts | 
|---|
| 41 | friend std::ostream &operator<<(std::ostream &ost, const SaturatedBond& _bond); | 
|---|
| 42 |  | 
|---|
| 43 | public: | 
|---|
| 44 | //!> typedef for a shared pointer of this class | 
|---|
| 45 | typedef boost::shared_ptr<SaturatedBond> ptr; | 
|---|
| 46 |  | 
|---|
| 47 | /** Cstor of class SaturatedBond, requires a present \a _bond. | 
|---|
| 48 | * | 
|---|
| 49 | * \param _bond bond to saturate | 
|---|
| 50 | * \param _remaining atom that is not cut off | 
|---|
| 51 | */ | 
|---|
| 52 | SaturatedBond(const bond &_bond, const atom& _remaining); | 
|---|
| 53 |  | 
|---|
| 54 | /** Dstor of SaturatedBond. | 
|---|
| 55 | * | 
|---|
| 56 | */ | 
|---|
| 57 | ~SaturatedBond() {} | 
|---|
| 58 |  | 
|---|
| 59 | //!> typedef for a vector of Vectors | 
|---|
| 60 | typedef std::vector<Vector> positions_t; | 
|---|
| 61 |  | 
|---|
| 62 | /** calculates positions where to place hydrogens to saturate this bond. | 
|---|
| 63 | * | 
|---|
| 64 | * \note Positions are always relative to \a saturated, i.e. to the atom | 
|---|
| 65 | * that is saturated. | 
|---|
| 66 | */ | 
|---|
| 67 | positions_t getPositions() const; | 
|---|
| 68 |  | 
|---|
| 69 | private: | 
|---|
| 70 | //!> SaturationDistanceMinimizer needs access to alpha and directional vectors | 
|---|
| 71 | friend class SaturationDistanceMaximizer; | 
|---|
| 72 |  | 
|---|
| 73 | //!> bond to saturate | 
|---|
| 74 | const bond& saturated_bond; | 
|---|
| 75 | //!> central atom which is saturated | 
|---|
| 76 | const atom& saturated_atom; | 
|---|
| 77 | //!> rotation angle describing position. | 
|---|
| 78 | double alpha; | 
|---|
| 79 | //!> Vector along the bond | 
|---|
| 80 | Vector BondVector; | 
|---|
| 81 | //!> first vector orthogonal to \a _bond | 
|---|
| 82 | Vector vector_a; | 
|---|
| 83 | //!> second vector orthogonal to \a _bond | 
|---|
| 84 | Vector vector_b; | 
|---|
| 85 | }; | 
|---|
| 86 |  | 
|---|
| 87 |  | 
|---|
| 88 |  | 
|---|
| 89 | #endif /* SATURATEDBOND_HPP_ */ | 
|---|