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