IMP  2.3.1
The Integrative Modeling Platform
FixedRefiner.h
Go to the documentation of this file.
1 /**
2  * \file IMP/core/FixedRefiner.h
3  * \brief A particle refiner which returns a fixed set of particles
4  *
5  * Copyright 2007-2014 IMP Inventors. All rights reserved.
6  */
7 
8 #ifndef IMPCORE_FIXED_REFINER_H
9 #define IMPCORE_FIXED_REFINER_H
10 
11 #include <IMP/core/core_config.h>
12 
13 #include <IMP/PairContainer.h>
14 #include <IMP/SingletonContainer.h>
15 #include <IMP/Refiner.h>
16 
17 IMPCORE_BEGIN_NAMESPACE
18 
19 //! The refiner can refine any particle by returning a fixed set
20 /**
21  */
22 class IMPCOREEXPORT FixedRefiner : public Refiner {
23  Model* m_;
25 
26  public:
27  //! Store the set of particles
29 
30  //! Store the set of particle indexes from passed model
32 
34  { return true; }
35 
36  //! Returns the fixed set of particles.
37  /** Returns the fixed set of particles, regardless of passed particle
38 
39  @param p coarse particle to be refined (ignored for FixedRefiner)
40  */
41  virtual const kernel::ParticlesTemp get_refined(kernel::Particle *p) const
43 
44  //! Return the indexes of the particles returned by get_refined()
45  /** Return the indexes of the particles returned by get_refined()
46  for particle pi in model m.
47 
48  @param pi coarse particle to be refined
49 
50  @note For FixedRefiner, this is a faster operation than
51  get_refined()
52 
53  @note It is assumed that the refined particles are also in model m.
54 
55  */
58  {
59  IMP_USAGE_CHECK(m == m_,
60  "mismatching models for refined and coarse particles");
61  IMP_UNUSED(m);
62  return pis_;
63  }
64 
66  (Model *m, ParticleIndex pi) const
67  {
68  IMP_USAGE_CHECK(m == m_,
69  "mismatching models for refined and coarse particles");
70  IMP_UNUSED(m);
71  IMP_UNUSED(pi);
72  return pis_;
73  }
74 
75 
76 #ifndef SWIG
78 #endif
82 };
83 
84 IMPCORE_END_NAMESPACE
85 
86 #endif /* IMPCORE_FIXED_REFINER_H */
The refiner can refine any particle by returning a fixed set.
Definition: FixedRefiner.h:22
virtual const ParticlesTemp get_refined(Particle *a) const =0
Refine the passed particle into a set of particles.
Import IMP/kernel/SingletonContainer.h in the namespace.
#define IMP_OBJECT_METHODS(Name)
Define the basic things needed by any Object.
Definition: object_macros.h:25
virtual bool get_can_refine(kernel::Particle *) const
Return true if this refiner can refine that particle.
Definition: FixedRefiner.h:33
Import IMP/kernel/PairContainer.h in the namespace.
Import IMP/kernel/Refiner.h in the namespace.
#define IMP_UNUSED(variable)
virtual ModelObjectsTemp do_get_inputs(kernel::Model *m, const ParticleIndexes &pis) const
Class to handle individual model particles.
virtual ParticleIndexes get_refined_indexes(Model *m, ParticleIndex pi) const
Return the indexes of the particles returned by get_refined()
#define IMP_USAGE_CHECK(expr, message)
A runtime test for incorrect usage of a class or method.
Definition: check_macros.h:170
Abstract class to implement hierarchical methods.
virtual ParticleIndexes const & get_refined_indexes_by_ref(Model *m, ParticleIndex pi) const
Return the indexes of the particles returned by get_refined()
#define IMP_OVERRIDE
Cause a compile error if this method does not override a parent method.
Class for storing model, its restraints, constraints, and particles.
Definition: kernel/Model.h:73