8 #ifndef IMPKERNEL_REFINER_H
9 #define IMPKERNEL_REFINER_H
11 #include <IMP/kernel/kernel_config.h>
14 #include "internal/IndexingIterator.h"
18 IMPKERNEL_BEGIN_NAMESPACE
34 Refiner(std::string name =
"Refiner %1%");
51 return get_refined(a)[i];
57 return get_refined(a).size();
67 typedef internal::IndexingIterator<Accessor> RefinedIterator;
68 RefinedIterator refined_begin(
Particle *a)
const;
69 RefinedIterator refined_end(
Particle *a)
const;
76 #if !defined(SWIG) && !defined(IMP_DOXYGEN)
77 struct Refiner::Accessor {
84 Particle *operator()(
unsigned int i)
const {
return r_->get_refined(p_, i); }
85 bool operator==(
const Accessor &o)
const {
return p_ == o.p_ && r_ == o.r_; }
89 inline Refiner::RefinedIterator Refiner::refined_begin(
Particle *a)
const {
90 return RefinedIterator(Accessor(a,
this), 0);
92 inline Refiner::RefinedIterator Refiner::refined_end(
Particle *a)
const {
93 return RefinedIterator(Accessor(a,
this), get_number_of_refined(a));
96 IMPKERNEL_END_NAMESPACE
virtual unsigned int get_number_of_refined(Particle *a) const
IMP::kernel::DerivativeAccumulator DerivativeAccumulator
virtual Particle * get_refined(Particle *a, unsigned int i) const
Get the ith refined particle.
Control display of deprecation information.
virtual bool get_can_refine(Particle *) const
Return true if this refiner can refine that particle.
Single variable function.
IMP::kernel::Refiner Refiner
Class to handle individual model particles.
Common base class for heavy weight IMP objects.
Classes to handle individual model particles.
#define IMP_OBJECTS(Name, PluralName)
Define the types for storing sets of objects.
IMP::kernel::Particle Particle
Abstract class to implement hierarchical methods.
Class for storing model, its restraints, constraints, and particles.