26 #include <utility/vector1.hh>
27 #include <numeric/xyz.functions.hh>
31 namespace conformation {
42 for (
Size ii = 1; ii <= res.
nheavyatoms(); ++ii ) atoms_placed[ ii ] =
true;
53 while ( n_remaining > 0 ) {
54 Size n_placed_this_iteration = 0;
56 bool all_stubs_placed =
true;
57 for (
Size jj = 1; jj <= 3; ++jj ) {
62 all_stubs_placed =
false;
66 if ( all_stubs_placed ) {
69 ++n_placed_this_iteration;
70 atoms_placed[ ii ] =
true;
74 if ( n_placed_this_iteration == 0 ) {
75 std::cerr <<
"Error from core::conformation::Residue.functions.cc.";
76 std::cerr <<
"Could not place the following hydrogens: ";
77 for (
Size ii = 1; ii <= res.
natoms(); ++ii ) {
78 if ( ! atoms_placed[ ii ] ) {
79 std::cerr << res.
atom_name( ii ) <<
" with atom stubs: ";
85 utility_exit_with_message(
"Failed to place ideal hydrogen positions" );
99 for (
Size ii = 1; ii <= rotamer.
nchi(); ++ii ) {
101 Real const ii_chi = numeric::dihedral(
102 rotamer.
xyz( ii_chi_atoms[ 1 ]),
103 rotamer.
xyz( ii_chi_atoms[ 2 ]),
104 rotamer.
xyz( ii_chi_atoms[ 3 ]),
105 rotamer.
xyz( ii_chi_atoms[ 4 ]) );
106 rotamer.
chi()[ ii ] = ii_chi;