17 #include <basic/Tracer.hh>
18 #include <utility/exit.hh>
20 #include <utility/string_util.hh>
21 #include <boost/lexical_cast.hpp>
22 #include <numeric/xyzVector.hh>
23 #include <numeric/conversions.hh>
26 #include <utility/vector1.hh>
29 static basic::Tracer
TR(
"protocols.topology.HSSTriplet" );
43 runtime_assert( parts.size() == 2 );
44 helix_ = boost::lexical_cast<
Size>( parts[1] );
47 runtime_assert( st.size() == 2 );
57 strand1_( hss.strand1_ ),
58 strand2_( hss.strand2_ )
139 Helix const & hx ( *ssinfo->helices()[
helix() ] );
143 runtime_assert( s1.length() >= 2 );
144 runtime_assert( s2.length() >= 2 );
147 Real dot_hs1 = hx.orient().dot( s1.orient() );
148 Real dot_hs2 = hx.orient().dot( s2.orient() );
177 Vector const hmid = hx.mid_pos();
178 Vector const s1_mid = s1.mid_pos();
179 Vector const s2_mid = s2.mid_pos();
182 Vector const s12_vec = ( s2_mid - s1_mid ).normalized();
183 Vector const hs1_vec = ( hmid - s1_mid ).normalized();
184 Real d = hs1_vec.cross( s12_vec ).dot( s1.orient() );
188 Vector const s1_chalf_mid = ( s1.mid_pos() + s1.Cend_pos() )/2.0;
189 Vector const s2_nhalf_mid = ( s2.mid_pos() + s2.Nend_pos() )/2.0;
190 Vector const v1 = ( s2_nhalf_mid - s1_chalf_mid ).normalized();
193 Vector const v2 = ( s1.Cend_orient() + sign_ss*s2.Nend_orient() ).normalized();
195 Vector sheet_plane = v1.cross( v2 );
198 hsheet_dist_ = sheet_plane.normalized().dot( hmid - s1_chalf_mid );
201 hs1_dist_ = ( s1.mid_pos() - hmid ).length();
204 hs2_dist_ = ( s2.mid_pos() - hmid ).length();
207 ss_dist_ = ( s2.mid_pos() - s1.mid_pos() ).length();
210 Vector const h1 = hx.Nend_pos() - sheet_plane.dot( hx.Nend_pos() - s2_nhalf_mid )*sheet_plane;
211 Vector const h2 = hx.Cend_pos() - sheet_plane.dot( hx.Cend_pos() - s2_nhalf_mid )*sheet_plane;
212 Vector const hx_on_sheet = ( h1 -
h2 ).normalized();
213 Real ori = cross( hx_on_sheet, v2 ).dot( sheet_plane );
214 hs_angle_ = numeric::conversions::degrees( angle_of( v2, hx_on_sheet ) );
269 for( HSSTriplets::const_iterator it=s.begin(), ite=s.end(); it!= ite; ++it ) {
279 hss_triplets_( s.hss_triplets_ ),
280 helix2hss_( s.helix2hss_ )
291 out <<
"#### HSSTriplet Info " << std::endl;
292 for( HSSTriplets::const_iterator iter = s.
hss_triplets().begin(),
293 iter_end = s.
hss_triplets().end(); iter != iter_end; ++iter ) {
295 out << hss << std::endl;
305 for( HSSTriplets::const_iterator it=s.begin(), ite=s.end(); it!= ite; ++it ) {
315 for ( std::map< Size, HSSTripletOP >::const_iterator it=
helix2hss_.begin(),
317 if ( it->first == hsop->helix() ) {
318 TR <<
"Helix " << it->first <<
" is already defined in HSSTriplet. " << std::endl;