/** * \file WeighedExcludedVolumeRestraint.cpp * \brief Calculate excluded volume bewteen rigid bodies. * * Copyright 2007-2010 IMP Inventors. All rights reserved. * */ #include #include IMPEM_BEGIN_NAMESPACE WeightedExcludedVolumeRestraint::WeightedExcludedVolumeRestraint( core::RigidBodies rbs, Refiner *refiner, FloatKey radius_key,FloatKey weight_key): Restraint("Weighted Excluded Volume Restraint") { IMP_LOG(TERSE,"Load WeightedExcludedVolumeRestraint \n"); rb_refiner_=refiner; add_particles(rbs); rbs_=rbs; initialize_model_density_map(radius_key,weight_key); } void WeightedExcludedVolumeRestraint::initialize_model_density_map( FloatKey radius_key,FloatKey weight_key) { for (core::RigidBodies::const_iterator it = rbs_.begin(); it != rbs_.end();it++){ core::RigidBody rb=*it; Particles 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 SurfaceShellDensityMap(rb_ps,1.)); } for(unsigned int i=0;iget_input_particles(*it); pt.insert(pt.end(), cur.begin(), cur.end()); ParticlesTemp curr= rb_refiner_->get_refined(*it); pt.insert(pt.end(), curr.begin(), curr.end()); } return pt; } ContainersTemp WeightedExcludedVolumeRestraint::get_input_containers() const { ContainersTemp pt; for (ParticleConstIterator it= particles_begin(); it != particles_end(); ++it) { ContainersTemp cur= rb_refiner_->get_input_containers(*it); pt.insert(pt.end(), cur.begin(), cur.end()); } return pt; } void WeightedExcludedVolumeRestraint::do_show(std::ostream& out) const { out<<"WeightedExcludedVolumeRestraint"<get_model() == (*particles_begin())->get_model(), "All particles in WeightedExcludedVolumeRestraint" " must belong to the " "same Model."); },{},{}); IMPEM_END_NAMESPACE