8 #ifndef BALL_MOLMEC_COMMON_SUPPORT_H
9 #define BALL_MOLMEC_COMMON_SUPPORT_H
15 #ifndef BALL_MATHS_SIMPLEBOX3_H
19 #ifndef BALL_MOLMEC_COMMON_FORCEFIELD_H
23 #ifndef BALL_MOLMEC_COMMON_ATOMVECTOR_H
27 #ifndef BALL_DATATYPE_HASHGRID_H
31 #ifndef BALL_KERNEL_BOND_H
45 namespace MolmecSupport
88 double distance,
bool periodic_boundary_enabled,
145 template <
typename TorsionType,
typename AtomIteratorType>
147 (
const AtomIteratorType& start,
const AtomIteratorType& end,
148 std::vector<TorsionType>& torsions,
bool use_selection =
false);
152 template <
typename TorsionType,
typename AtomIteratorType>
154 (
const AtomIteratorType& start,
const AtomIteratorType& end,
155 std::vector<TorsionType>& torsions,
bool use_selection)
163 Size number_of_added_torsions = 0;
167 AtomIteratorType atom_it = start;
168 for (; atom_it != end; ++atom_it)
173 for (; +it1 ; ++ it1)
177 if (*atom_it == it1->getFirstAtom())
182 a3 =
const_cast<Atom*
>(it1->getSecondAtom());
187 for (it2 = (*atom_it)->beginBond(); +it2 ; ++it2)
189 if (it2->getSecondAtom() != it1->getSecondAtom())
192 if (it2->getFirstAtom() == *atom_it)
194 a1 =
const_cast<Atom*
>(it2->getSecondAtom());
198 a1 =
const_cast<Atom*
>(it2->getFirstAtom());
201 for (it3 = const_cast<Atom*>(it1->getSecondAtom())->beginBond(); +it3 ; ++it3)
203 if (it3->getFirstAtom() != a2 )
206 if (it3->getFirstAtom() == a3)
208 a4 =
const_cast<Atom*
>(it3->getSecondAtom());
212 a4 =
const_cast<Atom*
>(it3->getFirstAtom());
215 if (use_selection ==
false
216 || (use_selection ==
true
226 torsions.push_back(tmp);
227 number_of_added_torsions++;
238 return number_of_added_torsions;
244 #endif // BALL_MOLMEC_COMMON_SUPPORT_H