Rosetta 3.5
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
IfMover.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 under license.
6 // (c) The Rosetta software is developed by the contributing members of the Rosetta Commons.
7 // (c) For more information, see http://www.rosettacommons.org. Questions about this can be
8 // (c) addressed to University of Washington UW TechTransfer, email: license@u.washington.edu.
9 
10 /// @file protocols/protein_interface_design/movers/IfMover.cc
11 /// @brief
12 /// @author Sarel Fleishman (sarelf@u.washington.edu)
13 /// @author Christopher Miles (cmiles@uw.edu)
14 
15 // Unit headers
18 
19 // C/C++ headers
20 #include <iostream>
21 #include <string>
22 
23 // Utility headers
24 #include <basic/Tracer.hh>
25 #include <utility/tag/Tag.hh>
26 
27 // Project headers
28 #include <core/pose/Pose.hh>
30 
31 // Package headers
33 #include <protocols/moves/Mover.hh>
34 #include <protocols/moves/util.hh>
35 
36 #include <utility/vector0.hh>
37 #include <utility/vector1.hh>
38 
39 
40 namespace protocols {
41 namespace moves {
42 
43 static basic::Tracer TR( "protocols.moves.IfMover" );
44 
46  return "If";
47 }
48 
50  return mover_name();
51 }
52 
54  return new IfMover();
55 }
56 
58  moves::MoverStatus status;
59 
60  if( filter_->apply(pose) ){
61  true_mover_->apply(pose);
62  status = true_mover_->get_last_move_status();
63  } else {
64  false_mover_->apply(pose);
65  status = false_mover_->get_last_move_status();
66  }
67 
68  // update this mover's status
70 }
71 
73  return true_mover_->get_additional_output();
74 }
75 
77  return false_mover_->get_additional_output();
78 }
79 
80 // backwards compatibility
83 }
84 
87 }
88 
91  protocols::filters::Filters_map const &filters,
92  protocols::moves::Movers_map const &movers,
93  core::pose::Pose const & ) {
94  using namespace protocols::filters;
95 
96  TR<<"If mover\n";
97  std::string const true_mover_name( tag->getOption< std::string >( "true_mover_name" ));
98  std::string const false_mover_name( tag->getOption< std::string >( "false_mover_name", "null" ));
99  std::string const filter_name( tag->getOption< std::string >( "filter_name" ) );
100 
101  /// see: protocols/moves/util.hh
102  filter_ = find_filter_or_die(filter_name, tag, filters);
103  true_mover_ = find_mover_or_die(true_mover_name, tag, movers);
104  false_mover_ = find_mover_or_die(false_mover_name, tag, movers);
105 
106  TR << "with true_mover \"" << true_mover_name
107  << "\" and false_mover \"" << false_mover_name
108  << "\" filter \"" << filter_name
109  << std::endl;
110 }
111 
112 } //moves
113 } //protocols
114