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.
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.
double get_distance(const Plane3D &pln, const Vector3D &p)
Return the distance between a plane and a point in 3D.
void add_attribute(TypeKey attribute_key, ParticleIndex particle, Type 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.
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.
void set_enclosing_sphere(XYZR b, const XYZs &v, double slack=0)
Set the coordinates and radius of the first to enclose the list.
Class for adding derivatives from restraints to the model.
A decorator for a particle with x,y,z coordinates and a radius.