9 #ifndef IMPCORE_XYZ_R_H
10 #define IMPCORE_XYZ_R_H
19 IMPCORE_BEGIN_NAMESPACE
31 do_setup_particle(m, pi, s.get_radius());
40 if (!XYZ::get_is_setup(m, pi)) {
61 double get_radius()
const {
return get_sphere().get_radius(); }
62 void set_radius(
double r)
const {
80 get_particle()->add_to_derivative(get_radius_key(), v, d);
153 IMP_PARTICLE_GEOMETRY(XYZDerivative,
core::XYZ, {
155 d.get_coordinates() + d.get_derivatives());
167 IMP_PARTICLE_PAIR_GEOMETRY(EdgePair,
core::XYZ, {
172 IMPCORE_END_NAMESPACE
ParticleIndex get_particle_index() const
Returns the particle index decorated by this decorator.
static FloatKey get_radius_key()
Get the key for the radius.
The base class for geometry.
XYZRs create_xyzr_particles(Model *m, unsigned int num, Float radius, Float box_side=10)
Create a set of particles with random coordinates.
#define IMP_DECORATOR_SETUP_1(Name, FirstArgumentType, first_argument_name)
Model * get_model() const
Returns the Model containing the particle.
macros for display classes
static XYZ setup_particle(Model *m, ParticleIndex pi)
double get_distance(XYZR a, XYZR b)
Compute the sphere distance between a and b.
Class for storing model, its restraints, constraints, and particles.
const algebra::Sphere3D & get_sphere() const
Return a sphere object.
Implement geometry for the basic shapes from IMP.algebra.
static bool get_is_setup(Model *m, ParticleIndex pi)
Check if the particle has the required attributes.
void add_attribute(TypeKey attribute_key, ParticleIndex particle, Type value)
add particle atribute with the specied key and initial value
void set_sphere(const algebra::Sphere3D &s)
Set the attributes from a sphere.
Represent an XYZR particle with a sphere.
A decorator for a particle with x,y,z coordinates.
#define IMP_DECORATOR_SETUP_0(Name)
Particle * get_particle() const
Returns the particle decorated by this decorator.
Simple implementation of segments in 3D.
void add_to_radius_derivative(double v, DerivativeAccumulator &d)
add v to the derivative of the radius attribute
algebra::Sphere3D get_enclosing_sphere(const XYZs &v)
Get a sphere enclosing the set of XYZRs.
#define IMP_DECORATOR_METHODS(Name, Parent)
double Float
Basic floating-point value (could be float, double...)
void set_enclosing_radius(XYZR b, const XYZs &v)
Set the radius of the first to enclose the list.
#define IMP_DECORATORS(Name, PluralName, Parent)
Define the types for storing sets of decorators.
bool get_has_attribute(TypeKey attribute_key, ParticleIndex particle) const
return true if particle has attribute with the specified key
void set_enclosing_sphere(XYZR b, const XYZs &v, double slack=0)
Set the coordinates and radius of the first to enclose the list.
double get_distance(const Line3D &s, const Vector3D &p)
Get closest distance between a line and a point.
Class for adding derivatives from restraints to the model.
A decorator for a particle with x,y,z coordinates and a radius.