00001 /** 00002 * \file QuadsConstraint.h 00003 * \brief Use a QuadModifier applied to a ParticleQuads to 00004 * maintain an invariant 00005 * 00006 * This file is generated by a script (core/tools/make-container). 00007 * Do not edit directly. 00008 * 00009 * Copyright 2007-2010 IMP Inventors. All rights reserved. 00010 */ 00011 00012 #ifndef IMPCONTAINER_QUADS_CONSTRAINT_H 00013 #define IMPCONTAINER_QUADS_CONSTRAINT_H 00014 00015 #include "container_config.h" 00016 #include <IMP/QuadContainer.h> 00017 #include <IMP/QuadModifier.h> 00018 #include <IMP/Constraint.h> 00019 00020 IMP_BEGIN_NAMESPACE 00021 // for swig 00022 class QuadContainer; 00023 class QuadModifier; 00024 IMP_END_NAMESPACE 00025 00026 IMPCONTAINER_BEGIN_NAMESPACE 00027 //! Apply a QuadFunction to a QuadContainer to maintain an invariant 00028 /** The score state is passed up to two QuadModifiers, one to 00029 apply before evaluation and the other after. The one after 00030 should take a DerivativeAccumulator as its last argument for 00031 QuadModifier::apply() and will only be called if 00032 the score was computed with derivatives. 00033 00034 An example showing a how to use such a score state to maintain a cover 00035 of the atoms of a protein by a sphere per residue. 00036 \verbinclude cover_particles.py 00037 00038 \see QuadConstraint 00039 */ 00040 class IMPCONTAINEREXPORT QuadsConstraint : public Constraint 00041 { 00042 IMP::internal::OwnerPointer<QuadModifier> f_; 00043 IMP::internal::OwnerPointer<QuadModifier> af_; 00044 IMP::internal::OwnerPointer<QuadContainer> c_; 00045 public: 00046 /** \param[in] c The Container to hold the elements to process 00047 \param[in] before The QuadModifier to apply to all elements 00048 before evaluate. 00049 \param[in] after The QuadModifier to apply to all elements 00050 after evaluate. 00051 \param[in] name The object name 00052 */ 00053 QuadsConstraint(QuadContainer *c, QuadModifier *before, 00054 QuadModifier *after, 00055 std::string name="QuadConstraint %1%"); 00056 00057 //! Apply this modifier to all the elements after an evaluate 00058 void set_after_evaluate_modifier(QuadModifier* f) { 00059 af_=f; 00060 } 00061 00062 //! Apply this modifier to all the elements before an evaluate 00063 void set_before_evaluate_modifier(QuadModifier* f) { 00064 f_=f; 00065 } 00066 00067 IMP_CONSTRAINT(QuadsConstraint); 00068 }; 00069 00070 00071 IMPCONTAINER_END_NAMESPACE 00072 00073 #endif /* IMPCONTAINER_QUADS_CONSTRAINT_H */