home
about
news
download
doc
source
systems
tests
bugs
contact
IMP Reference Guide
2.20.0
The Integrative Modeling Platform
IMP Manual
Reference Guide
Tutorial Index
Modules
Classes
Examples
include
IMP
example
version 2.20.0
ExampleSingletonModifier.h
Go to the documentation of this file.
1
/**
2
* \file IMP/example/ExampleSingletonModifier.h
3
* \brief A singleton modifier which wraps an attribute into a
4
* given range.
5
*
6
* Copyright 2007-2022 IMP Inventors. All rights reserved.
7
*/
8
9
#ifndef IMPEXAMPLE_EXAMPLE_SINGLETON_MODIFIER_H
10
#define IMPEXAMPLE_EXAMPLE_SINGLETON_MODIFIER_H
11
12
#include <IMP/example/example_config.h>
13
#include <
IMP/SingletonModifier.h
>
14
#include <
IMP/algebra/BoundingBoxD.h
>
15
#include <
IMP/singleton_macros.h
>
16
#include <cereal/access.hpp>
17
#include <cereal/types/base_class.hpp>
18
19
IMPEXAMPLE_BEGIN_NAMESPACE
20
21
//! An example singleton modifier
22
/** A simple singleton modifier which ensures the x,y,z coordinates
23
stay in a box by wrapping them.
24
25
Such a class could be coupled with an IMP::core::SingletonConstraint
26
or IMP::container::SingletonsConstraint to keep a set of particles
27
in a box.
28
29
\include range_restriction.py
30
31
The source code is as follows:
32
\include ExampleSingletonModifier.h
33
\include ExampleSingletonModifier.cpp
34
*/
35
class
IMPEXAMPLEEXPORT
ExampleSingletonModifier
:
public
SingletonModifier
{
36
algebra::BoundingBoxD<3>
bb_;
37
38
friend
class
cereal::access;
39
template
<
class
Archive>
void
serialize(Archive &ar) {
40
ar(cereal::base_class<SingletonModifier>(
this
), bb_);
41
}
42
IMP_OBJECT_SERIALIZE_DECL
(
ExampleSingletonModifier
);
43
44
public
:
45
ExampleSingletonModifier
(
const
algebra::BoundingBoxD<3>
&bb);
46
ExampleSingletonModifier
() {}
47
48
// note, Doxygen wants a semicolon at the end of macro lines
49
virtual
void
apply_index
(
Model
*m,
ParticleIndex
p)
const
50
override
;
51
virtual
ModelObjectsTemp
do_get_inputs
(
52
Model
*m,
const
ParticleIndexes
&pis)
const override
;
53
virtual
ModelObjectsTemp
do_get_outputs
(
54
Model
*m,
const
ParticleIndexes
&pis)
const override
;
55
IMP_SINGLETON_MODIFIER_METHODS
(
ExampleSingletonModifier
);
56
IMP_OBJECT_METHODS
(
ExampleSingletonModifier
);
57
};
58
59
IMPEXAMPLE_END_NAMESPACE
60
61
#endif
/* IMPEXAMPLE_EXAMPLE_SINGLETON_MODIFIER_H */
IMP::SingletonModifier
A base class for modifiers of ParticlesTemp.
Definition:
SingletonModifier.h:32
SingletonModifier.h
A Modifier on ParticlesTemp.
IMP_OBJECT_METHODS
#define IMP_OBJECT_METHODS(Name)
Define the basic things needed by any Object.
Definition:
object_macros.h:25
IMP::Index< ParticleIndexTag >
singleton_macros.h
Macros for various classes.
IMP::ParticleOutputs::do_get_outputs
virtual ModelObjectsTemp do_get_outputs(Model *m, const ParticleIndexes &pis) const =0
Overload this method to specify the outputs.
IMP::Vector
A more IMP-like version of the std::vector.
Definition:
Vector.h:42
IMP::Model
Class for storing model, its restraints, constraints, and particles.
Definition:
Model.h:86
IMP::example::ExampleSingletonModifier
An example singleton modifier.
Definition:
ExampleSingletonModifier.h:35
IMP_SINGLETON_MODIFIER_METHODS
#define IMP_SINGLETON_MODIFIER_METHODS(Name)
Definition:
singleton_macros.h:124
IMP_OBJECT_SERIALIZE_DECL
#define IMP_OBJECT_SERIALIZE_DECL(Name)
Declare methods needed for serialization of Object pointers.
Definition:
object_macros.h:95
BoundingBoxD.h
A bounding box in D dimensions.
IMP::ParticleInputs::do_get_inputs
virtual ModelObjectsTemp do_get_inputs(Model *m, const ParticleIndexes &pis) const =0
Overload this method to specify the inputs.
IMP::algebra::BoundingBoxD< 3 >
IMP::SingletonModifier::apply_index
virtual void apply_index(Model *m, ParticleIndex v) const =0