Rosetta 3.5
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
LoopRefineInnerCycleContainer.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 //
4 // (c) Copyright Rosetta Commons Member Institutions.
5 // (c) This file is part of the Rosetta software suite and is made available
6 // (c) under license. The Rosetta software is developed by the contributing
7 // (c) members of the Rosetta Commons. For more information, see
8 // (c) http://www.rosettacommons.org. Questions about this can be addressed to
9 // (c) University of Washington UW TechTransfer,email:license@u.washington.edu.
10 
11 /// @file protocols/loops/loop_mover/refine/LoopRefineInnerCycleContainer.cc
12 /// @brief This class is a LoopRefineInnerCycle that contains one or more other LoopRefineInnerCycles to allow a developer to
13 /// quickly string together existing LoopRefineInnerCycles in new ways to create new loop refinement protocols.
14 /// @detailed
15 ///
16 /// @author Brian D. Weitzner ( brian.weitzner@gmail.com )
17 
18 // Unit headers
21 
22 // Package headers
23 
24 // Project headers
26 #include <core/pose/Pose.hh>
30 
31 // Basic headers
32 #include <basic/Tracer.hh>
33 
34 // Utility headers
35 #include <utility/excn/Exceptions.hh>
36 #include <utility/vector1.hh>
37 
38 static basic::Tracer TR("protocols.loops.loop_mover.refine.LoopRefineInnerCycleContainer");
39 
40 namespace protocols {
41 namespace loops {
42 namespace loop_mover {
43 namespace refine {
44 
45 using utility::excn::EXCN_Msg_Exception;
46 
47 ///////////////////////////////////////////////////////////////////////////////////////////////////////
48 ////////////////////////////////////////////// BOILER PLATE CODE //////////////////////////////////////
49 ///////////////////////////////////////////////////////////////////////////////////////////////////////
50 
51 ///@brief default constructor
53 {
54  init();
55 }
56 
57 ///@brief copy constructor
59 {
61 }
62 
63 ///@brief assignment operator
65  //abort self-assignment
66  if ( this == &rhs ) return *this;
69  return *this;
70 }
71 
72 //destructor
74 
75 /// @brief Each derived class must specify its name.
77 {
78  return type();
79 }
80 
81 //@brief clone operator, calls the copy constructor
84 {
85  return new LoopRefineInnerCycleContainer( *this );
86 }
87 
88 ///@brief fresh_instance returns a default-constructed object for JD2
91 {
92  return new LoopRefineInnerCycleContainer();
93 }
94 
95 ///@brief This mover retains state such that a fresh version is needed if the input Pose is about to change
97 {
98  return true;
99 }
100 
102 {
103  /// PUT THE LIST OF OPTIONS THAT ARE USED HERE ///
104 
105  /// RECURSIVELY CALL REGISTER OPTIONS ON ALL MOVERS THAT THIS CLASS HAS AN OWNING_PTR TO ///
106 }
107 ///////////////////////////////////////////////////////////////////////////////////////////////////////
108 /////////////////////////////////////// END OF BOILER PLATE CODE //////////////////////////////////////
109 ///////////////////////////////////////////////////////////////////////////////////////////////////////
110 
112 {
113  // TR << "Beginning apply function of " + get_name() + "." << std::endl;
114 
115  setup_objects( pose );
116 
117  // show( TR );
118  // TR << "Applying each refinement step in this LoopInnerRefineCycleContainer..." << std::endl;
119 
120  inner_cycle_steps_->apply( pose );
121 }
122 
124 {
125  // TR << "Setting up data for " + get_name() + "." << std::endl;
126 
128 }
129 
131 {
132  type( "LoopRefineInnerCycleContainer" );
135 
136  init_options();
137 }
138 
142 )
143 {
144  // copy all data members from rhs to lhs
147 }
148 
150 {
151  /* UNCOMMENT WHEN THERE ARE ACTUALLY OPTIONS TO PROCESS
152  using basic::options::option;
153  using namespace basic::options::OptionKeys;
154  */
155  // Set options here.
156 }
157 
159 {
160  inner_cycle_list_.push_back( inner_cycle_step );
161  inner_cycle_steps_->add_mover( inner_cycle_step );
162 }
163 
164 // This could probably be simplified if I passed around function pointers, but who wants to deal with all that bullshit.
166 {
168 
169  for( InnerCycleList::iterator it = inner_cycle_list_.begin(); it != inner_cycle_list_.end(); ++it )
170  {
171  (*it)->set_mc( mc );
172  }
173 }
174 
176 {
178 
179  for( InnerCycleList::iterator it = inner_cycle_list_.begin(); it != inner_cycle_list_.end(); ++it )
180  {
181  (*it)->set_scorefxn( scorefxn );
182  }
183 }
184 
186 {
188 
189  for( InnerCycleList::iterator it = inner_cycle_list_.begin(); it != inner_cycle_list_.end(); ++it )
190  {
191  (*it)->set_task_factory( tf );
192  }
193 }
194 
196 {
197  LoopRefineInnerCycle::set_loop_mover( new_owner_in_town );
198 
199  for( InnerCycleList::iterator it = inner_cycle_list_.begin(); it != inner_cycle_list_.end(); ++it )
200  {
201  (*it)->set_loop_mover( new_owner_in_town );
202  }
203 }
204 
206 {
208 
209  for( InnerCycleList::iterator it = inner_cycle_list_.begin(); it != inner_cycle_list_.end(); ++it )
210  {
211  (*it)->set_native_pose( pose );
212  }
213 }
214 void
216 {
217  out << *this;
218 }
219 
220 std::ostream & operator<<(std::ostream& out, LoopRefineInnerCycleContainer const & loop_refine_inner_cycle_container )
221 {
222  out << loop_refine_inner_cycle_container.get_name() << " with the following LoopRefineInnerCycles: " << std::endl;
223  // Iterate over contained LoopRefineInnerCycles and print their names
224  LoopRefineInnerCycleContainer::InnerCycleList inner_cycle_list = loop_refine_inner_cycle_container.inner_cycle_list_;
225 
226  for( LoopRefineInnerCycleContainer::InnerCycleList::const_iterator it = inner_cycle_list.begin();
227  it != inner_cycle_list.end(); ++it )
228  {
229  out << " " << **it << std::endl;
230  }
231 
232  return out;
233 }
234 
236 
238  return new LoopRefineInnerCycleContainer();
239 }
240 
242  return "LoopRefineInnerCycleContainer";
243 }
244 
245 } // namespace refine
246 } // namespace loop_mover
247 } // namespace loops
248 } // namespace protocols