A decorator for a particle with x,y,z coordinates and a radius.
A simple example illustrating some of the functionality.
import IMP import IMP.core import IMP.algebra m= IMP.Model() p0= IMP.Particle(m) d0= IMP.core.XYZR.setup_particle(p0, IMP.algebra.Sphere3D(IMP.algebra.Vector3D(0,1,2), 1.0)) p1= IMP.Particle(m) d1= IMP.core.XYZR.setup_particle(p1) d1.set_coordinates(IMP.algebra.Vector3D(3,4,5)) d1.set_radius(2.0) print IMP.core.get_distance(d0, d1) # use them as XYZ particles xd0= IMP.core.XYZ.decorate_particle(p0) xd1= IMP.core.XYZ.decorate_particle(p1) # distance without radii print IMP.core.get_distance(xd0, xd1)
Examples: XYZR Decorator, cover particles, symmetry, filter close pairs, initialize chains, merge tree, shared functions, dock with crosslinks, rigid brownian dynamics, profile fit, multiscale, local fitting, analyze convergence, nup84 cg, optimize balls, connectivity restraint
Inheritance diagram for IMP::core::XYZR:Public Member Functions | |
| XYZR (Model *m, ParticleIndex id) | |
| XYZR (::IMP::Particle *p) | |
| void | add_to_radius_derivative (double v, DerivativeAccumulator &d) |
| double | get_radius () const |
| const algebra::Sphere3D & | get_sphere () const |
| Return a sphere object. | |
| void | set_radius (double r) const |
| void | set_sphere (const algebra::Sphere3D &s) |
| Set the attributes from a sphere. | |
Static Public Member Functions | |
| static XYZR | decorate_particle (::IMP::Particle *p) |
| static FloatKey | get_radius_key () |
| Get the default radius key. | |
| static bool | particle_is_instance (Particle *p) |
| Check if the particle has the required attributes. | |
| static XYZR | setup_particle (Particle *p) |
| static XYZR | setup_particle (Particle *p, Float radius) |
| static XYZR | setup_particle (Particle *p, const algebra::Sphere3D &s) |
Related Functions | |
(Note that these are not member functions.) | |
| XYZRs | create_xyzr_particles (Model *m, unsigned int num, Float radius, Float box_side=10) |
| Create a set of particles which random coordinates. | |
| double | get_distance (XYZR a, XYZR b) |
| Compute the distance between a pair of particles. | |
| algebra::Sphere3D | get_enclosing_sphere (const XYZs &v) |
| Get a sphere enclosing the set of XYZRs. | |
| void | set_enclosing_radius (XYZR b, const XYZs &v) |
| Set the radius of the first to enclose the list. | |
| void | set_enclosing_sphere (XYZR b, const XYZs &v, double slack=0) |
| Set the coordinates and radius of the first to enclose the list. | |
| static FloatKey IMP::core::XYZR::get_radius_key | ( | ) | [static] |
Get the default radius key.
| const algebra::Sphere3D& IMP::core::XYZR::get_sphere | ( | ) | const |
Return a sphere object.
| static bool IMP::core::XYZR::particle_is_instance | ( | Particle * | p | ) | [static] |
Check if the particle has the required attributes.
Reimplemented from IMP::core::XYZ.
Reimplemented in IMP::core::Cover, and IMP::atom::LennardJones.
| void IMP::core::XYZR::set_sphere | ( | const algebra::Sphere3D & | s | ) |
Set the attributes from a sphere.
Create a decorator using radius_key to store the FloatKey.
| [in] | p | The particle to wrap. |
Create a decorator using radius_key to store the FloatKey. The particle should already be an XYZ particle.
| [in] | p | The particle to wrap. |
| [in] | radius | The radius to set initially |
Reimplemented in IMP::atom::LennardJones.
Create a decorator using radius_key to store the FloatKey.
| [in] | p | The particle to wrap. |
| [in] | s | The sphere to use to set the position and radius |
| XYZRs create_xyzr_particles | ( | Model * | m, |
| unsigned int | num, | ||
| Float | radius, | ||
| Float | box_side = 10 |
||
| ) | [related] |
Create a set of particles which random coordinates.
This function is mostly to be used to keep demo code brief.
| [in] | m | The model to add them to. |
| [in] | num | The number of particles to create. |
| [in] | radius | The radius to give them. |
| [in] | box_side | The particles have coordinates from -box_side to box_side. |
The particles coordinates are optimized.
| algebra::Sphere3D get_enclosing_sphere | ( | const XYZs & | v | ) | [related] |
Get a sphere enclosing the set of XYZRs.
| [in] | v | The one whose radius should be set Any particle which does not have the attribute b.get_radius() is assumed to have a radius of 0. |
| void set_enclosing_radius | ( | XYZR | b, |
| const XYZs & | v | ||
| ) | [related] |
| void set_enclosing_sphere | ( | XYZR | b, |
| const XYZs & | v, | ||
| double | slack = 0 |
||
| ) | [related] |
Set the coordinates and radius of the first to enclose the list.
| [in] | v | The vector of XYZ or XYZR particles to enclose |
| [out] | b | The one whose values should be set |
| [in] | slack | An amount to add to the radius. Any particle which does not have the attribute b.get_radius() is assumed to have a radius of 0. |