IMP
2.0.0
The Integrative Modeling Platform
Main Page
Related Pages
Modules
Namespaces
Classes
Files
Examples
File List
File Members
ExampleComplexRestraint.h
Go to the documentation of this file.
1
/**
2
* \file IMP/example/ExampleComplexRestraint.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 IMPEXAMPLE_EXAMPLE_COMPLEX_RESTRAINT_H
9
#define IMPEXAMPLE_EXAMPLE_COMPLEX_RESTRAINT_H
10
11
#include <IMP/example/example_config.h>
12
13
#include <
IMP/PairContainer.h
>
14
#include <
IMP/SingletonContainer.h
>
15
#include <
IMP/Restraint.h
>
16
#include <
IMP/restraint_macros.h
>
17
#include <
IMP/ScoreState.h
>
18
#include <
IMP/UnaryFunction.h
>
19
20
IMPEXAMPLE_BEGIN_NAMESPACE
21
22
//! Restrain the diameter of a set of points
23
/** This restraint shows how to write a restraint that includes
24
a ScoreState which is needed to compute some invariant.
25
26
\note Be sure to check out the swig wrapper file and how it
27
wraps this class.
28
29
The source code is as follows:
30
\include ExampleComplexRestraint.h
31
\include ExampleComplexRestraint.cpp
32
33
*/
34
class
IMPEXAMPLEEXPORT
ExampleComplexRestraint
:
public
Restraint
35
{
36
Pointer<ScoreState> ss_;
37
Pointer<Particle> p_;
38
Float
diameter_;
39
Pointer<SingletonContainer> sc_;
40
Pointer<UnaryFunction> f_;
41
FloatKey
dr_;
42
public
:
43
//! Use f to restrain particles in sc to be within diameter of one another
44
/** f should have a minimum at 0 and be an upper bound-style function.
45
*/
46
ExampleComplexRestraint
(
UnaryFunction
*f,
47
SingletonContainer
*sc,
Float
diameter);
48
49
IMP_RESTRAINT
(
ExampleComplexRestraint
);
50
51
void
set_model(
Model
*m);
52
};
53
54
55
IMPEXAMPLE_END_NAMESPACE
56
57
#endif
/* IMPEXAMPLE_EXAMPLE_COMPLEX_RESTRAINT_H */