00001 /** 00002 * \file core/VolumeRestraint.h 00003 * \brief A prevent spheres from inter-penetrating 00004 * 00005 * Copyright 2007-2010 IMP Inventors. All rights reserved. 00006 */ 00007 00008 #ifndef IMPCORE_VOLUME_RESTRAINT_H 00009 #define IMPCORE_VOLUME_RESTRAINT_H 00010 00011 #include "core_config.h" 00012 00013 #include <IMP/algebra/Grid3D.h> 00014 00015 #include <IMP/SingletonContainer.h> 00016 #include <IMP/Restraint.h> 00017 #include <IMP/UnaryFunction.h> 00018 00019 IMPCORE_BEGIN_NAMESPACE 00020 00021 //! Restraint the volume of a set of spheres 00022 /** \untested{VolumeRestraint}*/ 00023 class IMPCOREEXPORT VolumeRestraint: public Restraint 00024 { 00025 IMP::internal::OwnerPointer<SingletonContainer> sc_; 00026 IMP::internal::OwnerPointer<UnaryFunction> f_; 00027 double volume_; 00028 typedef algebra::Grid3D<int> Grid; 00029 mutable Grid grid_; 00030 public: 00031 VolumeRestraint(UnaryFunction *f, 00032 SingletonContainer *sc, 00033 double volume); 00034 00035 IMP_RESTRAINT(VolumeRestraint); 00036 }; 00037 00038 00039 IMPCORE_END_NAMESPACE 00040 00041 #endif /* IMPCORE_VOLUME_RESTRAINT_H */