Rosetta 3.5
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
BigBinConstraint.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 core/scoring/constraints/BigBinConstraint.hh
11 /// @author James Thompson
12 
13 #ifndef INCLUDED_core_scoring_constraints_BigBinConstraint_hh
14 #define INCLUDED_core_scoring_constraints_BigBinConstraint_hh
15 
20 
22 #include <core/pose/Pose.fwd.hh>
25 
26 
27 #include <core/id/AtomID.hh>
28 
29 //Utility Headers
30 
31 // C++ Headers
32 #include <iostream>
33 
34 #include <utility/vector1.hh>
35 
36 
37 namespace core {
38 namespace scoring {
39 namespace constraints {
40 
41 
42 /// constraint on dihedral angle formed by 4 points
43 
44 class BigBinConstraint : public Constraint {
45 
46 public:
47 
48  virtual std::string type() const {
49  return "BigBin";
50  }
51 
52  virtual ConstraintOP clone() const {
53  return new BigBinConstraint( res_, bin_, sdev_ );
54  }
55 
56  void score( XYZ_Func const & xyz, EnergyMap const &, EnergyMap & emap ) const;
57 
58  // atom deriv
59  void
60  fill_f1_f2(
61  AtomID const &,
62  XYZ_Func const & xyz,
63  Vector &,
64  Vector &,
65  EnergyMap const &
66  ) const;
67 
68  ///c-tor
70  AtomID C0,
71  AtomID N1,
72  AtomID CA1,
73  AtomID C1,
74  AtomID N2,
75  AtomID CA2,
76  char bin,
78  ):
79  Constraint( scotype ),
80  C0_( C0 ),
81  N1_( N1 ),
82  CA1_( CA1 ),
83  C1_( C1 ),
84  N2_( N2 ),
85  CA2_( CA2 ),
86  bin_(bin)
87  {}
88 
91  res_( 0 ),
92  bin_( 'A' ),
93  sdev_( 0.5 )
94  {}
95 
96  BigBinConstraint( Size const res, char const bin, core::Real const sdev ) :
98  res_( res ),
99  bin_( bin ),
100  sdev_( sdev )
101  {}
102 
103  ///
104  Size
105  natoms() const {
106  return 6;
107  }
108 
109 
110  AtomID const &
111  atom( Size const n ) const
112  {
113  switch( n ) {
114  case 1:
115  return C0_;
116  case 2:
117  return N1_;
118  case 3:
119  return CA1_;
120  case 4:
121  return C1_;
122  case 5:
123  return N2_;
124  case 6:
125  return CA2_;
126  default:
127  utility_exit_with_message( "BigBinConstraint::atom() bad argument" );
128  }
129  return C0_;
130  }
131 
132  virtual void show( std::ostream & out ) const;
133 
134  void read_def( std::istream & in, pose::Pose const & pose, FuncFactory const & func_factory );
135 
136  char bin() const {
137  return bin_;
138  }
139 
140  Size res() const {
141  return res_;
142  }
143 
144  Real sdev() const {
145  return sdev_;
146  }
147 
148 private:
149  // data
152  char bin_;
154 
156 }; // class BigBinConstraint
157 
158 } // constraints
159 } // scoring
160 } // core
161 
162 #endif