/** * \file WeighedExcludedVolumeRestraint.cpp * \brief Calculate excluded volume bewteen rigid bodies. * * Copyright 2007-2013 IMP Inventors. All rights reserved. * */ #include #include IMPMULTIFIT_BEGIN_NAMESPACE WeightedExcludedVolumeRestraint::WeightedExcludedVolumeRestraint( core::RigidBodies rbs, Refiner *refiner, FloatKey weight_key): Restraint(IMP::internal::get_model(rbs), "Weighted Excluded Volume Restraint") { IMP_LOG_TERSE("Load WeightedExcludedVolumeRestraint \n"); rb_refiner_=refiner; add_particles(rbs); rbs_=rbs; initialize_model_density_map(weight_key); } void WeightedExcludedVolumeRestraint::initialize_model_density_map( FloatKey ) { for (core::RigidBodies::const_iterator it = rbs_.begin(); it != rbs_.end();it++){ core::RigidBody rb=*it; ParticlesTemp rb_ps=rb_refiner_->get_refined(rb); std::cout<<"Creating a density map for:" < transformed_maps; // for(int rb_i=0;rb_iget_refined(rbs_[i]); resampled_surfaces.push_back(new em::SurfaceShellDensityMap(rb_ps,1.)); } for(unsigned int i=0;iget_inputs(get_model(), IMP::get_indexes(ParticlesTemp(particles_begin(), particles_end()))); for (ParticleConstIterator it= particles_begin(); it != particles_end(); ++it) { ParticlesTemp curr= rb_refiner_->get_refined(*it); ret += curr; } return ret; } IMP_LIST_IMPL(WeightedExcludedVolumeRestraint, Particle, particle,Particle*, Particles); IMPMULTIFIT_END_NAMESPACE