9 #ifndef IMPKERNEL_REFINER_MACROS_H
10 #define IMPKERNEL_REFINER_MACROS_H
11 #include <IMP/kernel/kernel_config.h>
18 #define IMP_REFINER(Name) \
19 IMPKERNEL_DEPRECATED_MACRO(2.1, "Declare methods yourself"); \
20 virtual bool get_can_refine(Particle *) const; \
21 virtual const ParticlesTemp get_refined(Particle *) const; \
22 virtual Particle *get_refined(Particle *, unsigned int) const; \
23 virtual unsigned int get_number_of_refined(Particle *) const; \
24 IMP_BACKWARDS_MACRO_INPUTS; \
25 IMP_OBJECT_NO_WARNING(Name)
29 #define IMP_SIMPLE_REFINER(Name) \
30 IMPKERNEL_DEPRECATED_MACRO(2.1, "Declare methods yourself"); \
31 virtual bool get_can_refine(Particle *) const; \
32 virtual Particle *get_refined(Particle *, unsigned int) const; \
33 virtual const ParticlesTemp get_refined(Particle *a) const { \
34 ParticlesTemp ret(get_number_of_refined(a)); \
35 for (unsigned int i = 0; i < ret.size(); ++i) { \
36 ret[i] = get_refined(a, i); \
40 virtual unsigned int get_number_of_refined(Particle *) const; \
41 IMP_BACKWARDS_MACRO_INPUTS; \
42 IMP_OBJECT_NO_WARNING(Name)
46 #define IMP_SINGLETON_MODIFIER_FROM_REFINED(Name, refiner) \
47 IMPKERNEL_DEPRECATED_MACRO(2.1, "Define methods yourself"); \
48 ModelObjectsTemp Name::do_get_inputs(kernel::Model *m, \
49 const ParticleIndexes &pis) const { \
50 ModelObjectsTemp ret = refiner->get_inputs(m, pis); \
51 ret += IMP::kernel::get_particles(m, pis); \
52 for (unsigned int i = 0; i < pis.size(); ++i) { \
54 IMP::kernel::get_particles(refiner->get_refined_indexes(m, pis[i])); \
58 ModelObjectsTemp Name::do_get_outputs(kernel::Model *m, \
59 const ParticleIndexes &pis) const { \
60 ModelObjectsTemp ret = IMP::kernel::get_particles(m, pis); \
63 IMP_REQUIRE_SEMICOLON_NAMESPACE
67 #define IMP_SINGLETON_MODIFIER_TO_REFINED(Name, refiner) \
68 IMPKERNEL_DEPRECATED_MACRO(2.1, "Define methods yourself"); \
69 ModelObjectsTemp Name::do_get_inputs(kernel::Model *m, \
70 const ParticleIndexes &pis) const { \
71 ModelObjectsTemp ret = refiner->get_inputs(m, pis); \
72 for (unsigned int i = 0; i < pis.size(); ++i) { \
74 IMP::kernel::get_particles(refiner->get_refined_indexes(m, pis[i])); \
76 ret += IMP::kernel::get_particles(m, pis); \
79 ModelObjectsTemp Name::do_get_outputs(kernel::Model *m, \
80 const ParticleIndexes &pis) const { \
81 ModelObjectsTemp ret; \
82 for (unsigned int i = 0; i < pis.size(); ++i) { \
84 IMP::kernel::get_particles(refiner->get_refined_indexes(m, pis[i])); \
88 IMP_REQUIRE_SEMICOLON_NAMESPACE
Abstract base class for containers of particles.
Refine a particle into a list of particles.
Various general useful macros for IMP.