Rosetta 3.5
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
SavePoseMover.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 src/protocols/moves/SavePoseMover.cc
11 /// @author Florian Richter (floric@u.washington.edu)
12 
13 // Unit Headers
16 
17 //project headers
18 #include <core/pose/Pose.hh>
20 
21 // AUTO-REMOVED #include <protocols/moves/DataMap.hh>
23 #include <basic/Tracer.hh>
24 
25 #include <utility/tag/Tag.hh>
26 
27 #include <utility/vector0.hh>
28 #include <utility/excn/Exceptions.hh>
29 #include <utility/vector1.hh>
30 
31 // C++ Headers
32 
33 // ObjexxFCL Headers
34 
35 static basic::Tracer TR( "protocols.simple_moves.SavePoseMover" );
36 
37 namespace protocols {
38 namespace rosetta_scripts {
39 
42 {
44 }
45 
48  return new SavePoseMover;
49 }
50 
53 {
54  return "SavePoseMover";
55 }
56 
58  Mover( "SavePoseMover" ),
59  reference_pose_(NULL),
60  restore_pose_(false)
61 {
62 }
63 
65 
66 void
68 {
69  if( !restore_pose_ ) *reference_pose_ = pose;
70  else pose = *reference_pose_;
71 
72  //make sure this always counts as success
74 }
75 
76 void
78 {
79  if( tag->hasOption("reference_name") ){
80  reference_pose_ = saved_reference_pose(tag,data_map );
81  }
82 
83  else throw utility::excn::EXCN_RosettaScriptsOption("Need to specify name under which to save pose.");
84 
85  if( tag->hasOption( "pdb_file" ) ){
86  std::string const template_pdb_fname( tag->getOption< std::string >( "pdb_file" ));
87  core::import_pose::pose_from_pdb( *reference_pose_, template_pdb_fname );
88  TR <<"reading in " << template_pdb_fname << " pdb with " << reference_pose_->total_residue() <<" residues"<<std::endl;
89  }
90 
91 
92  if( tag->hasOption("restore_pose") ){
93  restore_pose_ = tag->getOption<bool>("restore_pose",1);
94  }
95 }
96 
99  return "SavePoseMover";
100 }
101 
104  return new SavePoseMover( *this );
105 }
106 
109  return new SavePoseMover;
110 }
111 
112 
113 } // moves
114 } // protocols
115