Rosetta 3.5
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
ResidueTorsionRestraints.hh
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/ligand_docking/ResidueTorsionRestraints.hh
11 ///
12 /// @brief
13 /// @author Ian W. Davis
14 
15 
16 #ifndef INCLUDED_protocols_ligand_docking_ResidueTorsionRestraints_hh
17 #define INCLUDED_protocols_ligand_docking_ResidueTorsionRestraints_hh
18 
19 #include <core/pose/Pose.fwd.hh>
20 #include <core/scoring/constraints/Constraint.hh> ///TODO .fwd fails (why?)
23 #include <utility/pointer/ReferenceCount.hh>
24 #include <set>
25 #include <core/types.hh>
26 
27 #include <utility/vector1.hh>
28 
29 
30 namespace protocols {
31 namespace ligand_docking {
32 
33 ///@brief Manages harmonic restraints on torsions, so they can be turned off for packing.
34 ///
35 ///@details Restraints are created when object is created, so they start off enabled.
36 /// I had to change from a PoseOP in the constructor to Pose references in enable/disable
37 /// because Movers only get Pose references, not PoseOPs.
38 /// Do not try to use one of these with multiple different poses, or surely the C++ gods will smite thee.
39 ///
41 {
42 public:
43 
44  ///@brief Establishes initial constraints set -- constraints start off enabled.
46  core::pose::Pose & pose,
47  core::Size resid,
48  core::Real stddev_degrees
49  );
51 
52  ///@brief Constrain residue torsions for specified pose.
53  virtual void enable( core::pose::Pose & pose );
54 
55  ///@brief Remove residue torsions constraints added by this object (if any).
56  virtual void disable( core::pose::Pose & pose );
57 
58  bool operator==(const ResidueTorsionRestraints &other);
59 
60 private:
61 
62  ///@brief Shared logic for creating torsional constraints
63  virtual void setup_constraints(core::pose::Pose & pose);
64 
65  ///@brief Shared logic; returns old_constraints without my_constraints_
66  virtual
70  std::set< core::scoring::constraints::ConstraintCOP > & removed_constraints
71  );
72 
75  /// Constraints that were created and added by this object.
76  /// We compare by to_string() names rather than object identity
77  /// because copying a Pose creates a deep copy of its constraints.
78  std::set< std::string > my_constraints_;
79  // Values from the last time a pose was disabled():
81  std::set< core::scoring::constraints::ConstraintCOP > old_constraints_;
82 
83 }; // ResidueTorsionRestraints
84 
85 
86 } // namespace ligand_docking
87 } // namespace protocols
88 
89 #endif // INCLUDED_protocols_ligand_docking_ResidueTorsionRestraints_HH