IMP logo
Public Member Functions | Static Public Member Functions | Related Functions
IMP::core::XYZR Class Reference

Detailed Description

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:

List of all members.

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.

Member Function Documentation

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.

static XYZR IMP::core::XYZR::setup_particle ( Particle p) [static]

Create a decorator using radius_key to store the FloatKey.

Parameters:
[in]pThe particle to wrap.
static XYZR IMP::core::XYZR::setup_particle ( Particle p,
Float  radius 
) [static]

Create a decorator using radius_key to store the FloatKey. The particle should already be an XYZ particle.

Parameters:
[in]pThe particle to wrap.
[in]radiusThe radius to set initially

Reimplemented in IMP::atom::LennardJones.

static XYZR IMP::core::XYZR::setup_particle ( Particle p,
const algebra::Sphere3D &  s 
) [static]

Create a decorator using radius_key to store the FloatKey.

Parameters:
[in]pThe particle to wrap.
[in]sThe sphere to use to set the position and radius

Friends And Related Function Documentation

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.

Parameters:
[in]mThe model to add them to.
[in]numThe number of particles to create.
[in]radiusThe radius to give them.
[in]box_sideThe particles have coordinates from -box_side to box_side.

The particles coordinates are optimized.

double get_distance ( XYZR  a,
XYZR  b 
) [related]

Compute the distance between a pair of particles.

algebra::Sphere3D get_enclosing_sphere ( const XYZs &  v) [related]

Get a sphere enclosing the set of XYZRs.

Parameters:
[in]vThe 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]

Set the radius of the first to enclose the list.

Parameters:
[in]vThe vector of XYZ or XYZR particles to enclose
[out]bThe 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_sphere ( XYZR  b,
const XYZs &  v,
double  slack = 0 
) [related]

Set the coordinates and radius of the first to enclose the list.

Parameters:
[in]vThe vector of XYZ or XYZR particles to enclose
[out]bThe one whose values should be set
[in]slackAn 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.
Note:
This function produces tighter bounds if the CGAL library is available.

The documentation for this class was generated from the following file:

Generated on Fri Feb 10 2012 23:36:26 for IMP by doxygen 1.7.5.1