Rosetta 3.5
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
ExternalGeomSampler.cc
Go to the documentation of this file.
1 // -*- mode:c++;tab-width:2;indent-tabs-mode:t;show-trailing-whitespace:t;rm-trailing-spaces:t -*-
2 // vi: set ts=2 noet:
3 // :noTabs=false:tabSize=4:indentSize=4:
4 //
5 // (c) Copyright Rosetta Commons Member Institutions.
6 // (c) This file is part of the Rosetta software suite and is made available under license.
7 // (c) The Rosetta software is developed by the contributing members of the Rosetta Commons.
8 // (c) For more information, see http://www.rosettacommons.org. Questions about this can be
9 // (c) addressed to University of Washington UW TechTransfer, email: license@u.washington.edu.
10 
11 /// @file protocols/toolbox/match_enzdes_util/ExternalGeomSampler.cc
12 /// @brief
13 /// @author Alex Zanghellini (zanghell@u.washington.edu)
14 /// @author Andrew Leaver-Fay (aleaverfay@gmail.com), porting to mini
15 
17 
18 #include <utility/vector1.hh>
19 
20 
21 namespace protocols {
22 namespace toolbox {
23 namespace match_enzdes_util {
24 
26 
28  parent(),
29  dis_D1D2_( 0.0 ),
30  dis_D2D3_( 0.0 ),
31  ang_D1D2D3_( 0.0 ),
32  transforms_uptodate_( false )
33 {}
34 
35 
37 :
38  parent(),
39  dis_U1D1_samples_( other.dis_U1D1_samples_ ),
40  ang_U2D1_samples_( other.ang_U2D1_samples_ ),
41  tor_U3D1_samples_( other.tor_U3D1_samples_ ),
42  ang_U1D2_samples_( other.ang_U1D2_samples_ ),
43  tor_U2D2_samples_( other.tor_U2D2_samples_ ),
44  tor_U1D3_samples_( other.tor_U1D3_samples_ ),
45  dis_D1D2_( other.dis_D1D2_ ),
46  dis_D2D3_( other.dis_D2D3_ ),
47  ang_D1D2D3_( other.ang_D1D2D3_ ),
48  transforms_uptodate_( other.transforms_uptodate_ ),
49  transforms_( other.transforms_ )
50 {}
51 
52 ExternalGeomSampler const &
54 {
55  if ( & rhs != this ) {
62  dis_D1D2_ = rhs.dis_D1D2_;
63  dis_D2D3_ = rhs.dis_D2D3_;
67  }
68 
69  return *this;
70 }
71 
72 
73 
75 {
76  transforms_uptodate_ = false;
78 }
79 
81 {
82  transforms_uptodate_ = false;
84 }
85 
87 {
88  transforms_uptodate_ = false;
90 }
91 
93 {
94  transforms_uptodate_ = false;
96 }
97 
99 {
100  transforms_uptodate_ = false;
102 }
103 
105 {
106  transforms_uptodate_ = false;
108 }
109 
110 void ExternalGeomSampler::set_tor_U3D1_samples( std::list< Real > const & tor_U3D1_samples )
111 {
112  transforms_uptodate_ = false;
113  tor_U3D1_samples_.resize( tor_U3D1_samples.size() );
114  std::copy( tor_U3D1_samples.begin(), tor_U3D1_samples.end(), tor_U3D1_samples_.begin() );
115 }
116 
117 void ExternalGeomSampler::set_dis_U1D1_samples( std::list< Real > const & dis_U1D1_samples )
118 {
119  transforms_uptodate_ = false;
120  dis_U1D1_samples_.resize( dis_U1D1_samples.size() );
121  std::copy( dis_U1D1_samples.begin(), dis_U1D1_samples.end(), dis_U1D1_samples_.begin() );
122 }
123 
124 void ExternalGeomSampler::set_ang_U2D1_samples( std::list< Real > const & ang_U2D1_samples )
125 {
126  transforms_uptodate_ = false;
127  ang_U2D1_samples_.resize( ang_U2D1_samples.size() );
128  std::copy( ang_U2D1_samples.begin(), ang_U2D1_samples.end(), ang_U2D1_samples_.begin() );
129 }
130 
131 void ExternalGeomSampler::set_ang_U1D2_samples( std::list< Real > const & ang_U1D2_samples )
132 {
133  transforms_uptodate_ = false;
134  ang_U1D2_samples_.resize( ang_U1D2_samples.size() );
135  std::copy( ang_U1D2_samples.begin(), ang_U1D2_samples.end(), ang_U1D2_samples_.begin() );
136 }
137 
138 void ExternalGeomSampler::set_tor_U2D2_samples( std::list< Real > const & tor_U2D2_samples )
139 {
140  transforms_uptodate_ = false;
141  tor_U2D2_samples_.resize( tor_U2D2_samples.size() );
142  std::copy( tor_U2D2_samples.begin(), tor_U2D2_samples.end(), tor_U2D2_samples_.begin() );
143 }
144 
145 void ExternalGeomSampler::set_tor_U1D3_samples( std::list< Real > const & tor_U1D3_samples )
146 {
147  transforms_uptodate_ = false;
148  tor_U1D3_samples_.resize( tor_U1D3_samples.size() );
149  std::copy( tor_U1D3_samples.begin(), tor_U1D3_samples.end(), tor_U1D3_samples_.begin() );
150 }
151 
154  transforms_uptodate_ = false;
155 }
156 
159  transforms_uptodate_ = false;
160 }
161 
163  ang_D1D2D3_ = ang_in_degrees;
164  transforms_uptodate_ = false;
165 }
166 
167 /// @brief Must be called after the samples are set, and the
168 /// internal geometry of the three downstream coordinates
169 /// (point 4, 5, and 6) are described. Does nothing if the transforms
170 /// are up to date.
171 void
173 {
175  transforms_[ HT_tor_U3D1 ].resize( tor_U3D1_samples_.size() );
176  transforms_[ HT_ang_U2D1 ].resize( ang_U2D1_samples_.size() );
177  transforms_[ HT_tor_U2D2 ].resize( tor_U2D2_samples_.size() );
178  transforms_[ HT_ang_U1D2 ].resize( ang_U1D2_samples_.size() );
179  transforms_[ HT_tor_U1D3 ].resize( tor_U1D3_samples_.size() );
180 
181  for ( Size ii = 1; ii <= tor_U3D1_samples_.size(); ++ii ) {
182  transforms_[ HT_tor_U3D1 ][ ii ].set_zaxis_rotation_deg( tor_U3D1_samples_[ ii ] );
183  }
184 
185  for ( Size ii = 1; ii <= ang_U2D1_samples_.size(); ++ii ) {
186  // negative rotation about the x axis of a magnitude 180 - angle 2-3-4
187  transforms_[ HT_ang_U2D1 ][ ii ].set_xaxis_rotation_deg( -1 * ( 180 - ang_U2D1_samples_[ ii ] ));
188  }
189 
190  for ( Size ii = 1; ii <= tor_U2D2_samples_.size(); ++ii ) {
191  transforms_[ HT_tor_U2D2 ][ ii ].set_zaxis_rotation_deg( tor_U2D2_samples_[ ii ] );
192  }
193 
194 
195  for ( Size ii = 1; ii <= ang_U1D2_samples_.size(); ++ii ) {
196  // negative rotation about the x axis of a magnitude 180 - angle B
197  transforms_[ HT_ang_U1D2 ][ ii ].set_xaxis_rotation_deg( -1 * ( 180 - ang_U1D2_samples_[ ii ] ) );
198  // pre-multiply by the stride from atom 4 to atom 5.
199  transforms_[ HT_ang_U1D2 ][ ii ].walk_along_z( dis_D1D2_ );
200  }
201 
202  HTReal ht_ang_d1d2d3;
203  ht_ang_d1d2d3.set_xaxis_rotation_deg( -1 * ( 180 - ang_D1D2D3_ ) );
204  for ( Size ii = 1; ii <= tor_U1D3_samples_.size(); ++ii ) {
205  /// pre-multiply by the bond angle and the step along z.
206  HTReal ht_tor_U1D3_zrot;
207  ht_tor_U1D3_zrot.set_zaxis_rotation_deg( tor_U1D3_samples_[ ii ] );
208  transforms_[ HT_tor_U1D3 ][ ii ] = ht_tor_U1D3_zrot * ht_ang_d1d2d3;
209  transforms_[ HT_tor_U1D3 ][ ii ].walk_along_z( dis_D2D3_ );
210  }
211 
212  transforms_uptodate_ = true;
213 }
214 
215 
216 void
218 {
219  transforms_uptodate_ = false;
220 
221  utility::vector1< Real > new_angU2D1_samples = ang_U1D2_samples_;
223  ang_U2D1_samples_ = new_angU2D1_samples;
224 
225  utility::vector1< Real > new_torU3D1_samples = tor_U1D3_samples_;
227  tor_U3D1_samples_ = new_torU3D1_samples;
228 }
229 
230 }
231 }
232 }
233