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