IMP  2.0.0
The Integrative Modeling Platform
DiameterRestraint.h
Go to the documentation of this file.
1 /**
2  * \file IMP/core/DiameterRestraint.h
3  * \brief A restraint to maintain the diameter of a set of points
4  *
5  * Copyright 2007-2013 IMP Inventors. All rights reserved.
6  */
7 
8 #ifndef IMPCORE_DIAMETER_RESTRAINT_H
9 #define IMPCORE_DIAMETER_RESTRAINT_H
10 
11 #include <IMP/core/core_config.h>
12 
13 #include "internal/remove_pointers.h"
14 #include <IMP/PairContainer.h>
15 #include <IMP/SingletonContainer.h>
16 #include <IMP/Restraint.h>
17 #include <IMP/restraint_macros.h>
18 #include <IMP/UnaryFunction.h>
19 
20 IMPCORE_BEGIN_NAMESPACE
21 
22 //! Restrain the diameter of a set of points
23 /** This class also serves as an example of how to build restraints which
24  have internal ScoreStates and perhaps more than one actual restraint
25  object.
26 
27  The diameter scored includes the radius of the involved particles.
28 
29  \note, Currently, decomposing this restraint results in pieces which
30  score deviations from the diameter with a harmonic upper bound of strength
31  1.
32  */
33 class IMPCOREEXPORT DiameterRestraint: public Restraint
34 {
35  IMP::OwnerPointer<ScoreState> ss_;
36  IMP::OwnerPointer<Particle> p_;
37  Float diameter_;
38  IMP::OwnerPointer<SingletonContainer> sc_;
39  IMP::OwnerPointer<UnaryFunction> f_;
40  FloatKey dr_;
41  void init();
42 public:
43  //! Use f to restraint sc to be withing diameter of one another
44  /** f should have a minimum at 0 and be an upper bound-style function.
45  */
47  SingletonContainer *sc, Float diameter);
48 
50 #ifndef IMP_DOXYGEN
53 #endif
54 };
55 
56 
57 IMPCORE_END_NAMESPACE
58 
59 #endif /* IMPCORE_DIAMETER_RESTRAINT_H */