00001 /** 00002 * \file QuadConstraint.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 IMPCORE_QUAD_CONSTRAINT_H 00013 #define IMPCORE_QUAD_CONSTRAINT_H 00014 00015 #include "core_config.h" 00016 #include <IMP/QuadModifier.h> 00017 #include <IMP/Constraint.h> 00018 #include <IMP/Particle.h> 00019 00020 IMP_BEGIN_NAMESPACE 00021 // for swig 00022 class QuadModifier; 00023 IMP_END_NAMESPACE 00024 00025 IMPCORE_BEGIN_NAMESPACE 00026 //! Apply a QuadFunction to a Quad 00027 /** The score state is passed up to two QuadModifiers, one to 00028 apply before evaluation and the other after. The one after 00029 should take a DerivativeAccumulator as its last argument for 00030 QuadModifier::apply() and will only be called if 00031 the score was computed with derivatives. 00032 00033 \see QuadsConstraint 00034 */ 00035 class IMPCOREEXPORT QuadConstraint : public Constraint 00036 { 00037 IMP::internal::OwnerPointer<QuadModifier> f_; 00038 IMP::internal::OwnerPointer<QuadModifier> af_; 00039 ParticleQuad v_; 00040 public: 00041 /** before and after are the modifiers to apply before and after 00042 evaluate. 00043 */ 00044 QuadConstraint(QuadModifier *before, 00045 QuadModifier *after, const ParticleQuad& vt, 00046 std::string name="QuadConstraint %1%"); 00047 00048 //! Apply this modifier to all the elements after an evaluate 00049 void set_after_evaluate_modifier(QuadModifier* f) { 00050 af_=f; 00051 } 00052 00053 //! Apply this modifier to all the elements before an evaluate 00054 void set_before_evaluate_modifier(QuadModifier* f) { 00055 f_=f; 00056 } 00057 00058 IMP_CONSTRAINT(QuadConstraint); 00059 }; 00060 00061 00062 IMPCORE_END_NAMESPACE 00063 00064 #endif /* IMPCORE_QUAD_CONSTRAINT_H */