Rosetta 3.5
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
RestrictOperationsBase.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/toolbox/task_operations/RestrictOperationsBase.cc
11 /// @brief Base class for PoseMetricCalculator-using TaskOperations
12 /// @author Steven Lewis smlewi@gmail.com
13 
14 // Unit Headers
16 
17 // Project Headers
18 #include <core/pose/Pose.hh>
19 
20 #include <basic/MetricValue.hh>
21 
22 // Utility Headers
23 //#include <core/types.hh>
24 #include <utility/vector1_bool.hh>
25 //#include <basic/Tracer.hh>
26 
27 // C++ headers
28 #include <set>
29 
30 #include <utility/vector1.hh>
31 
32 //static basic::Tracer TR( "protocols.toolbox.TaskOperations.RestrictOperationsBase" );
33 
34 namespace protocols {
35 namespace toolbox {
36 namespace task_operations {
37 
39 
41 
42 void
44  core::pose::Pose const & pose,
45  std::string const & calculator,
46  std::string const & calculation,
47  utility::vector1_bool & residues ) const
48 {
49  runtime_assert(residues.size() == pose.total_residue());
50 
51  //find the set of residues
52  typedef std::set< core::Size > SizeSet;
53  basic::MetricValue< SizeSet > mv_sizeset;
54  pose.metric(calculator, calculation, mv_sizeset);
55  SizeSet const & sizeset(mv_sizeset.value());
56 
57  //insert this into the vector
58  for(SizeSet::const_iterator it(sizeset.begin()), end(sizeset.end()) ; it != end; ++it){
59  //TR << *it << std::endl;
60  residues[*it] = true;
61  }
62 
63  return;
64 }
65 
66 } //namespace protocols
67 } //namespace toolbox
68 } //namespace task_operations