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 {
63 get_model()->get_sphere(get_particle_index())[3] = r;
68 return get_model()->get_sphere(get_particle_index());
73 get_model()->get_sphere(get_particle_index()) = s;
78 get_particle()->add_to_derivative(get_radius_key(), v, d);
162 IMP_PARTICLE_GEOMETRY(XYZDerivative,
core::XYZ, {
164 d.get_coordinates() + d.get_derivatives());
176 IMP_PARTICLE_PAIR_GEOMETRY(EdgePair,
core::XYZ, {
181 IMPCORE_END_NAMESPACE
186 IMPKERNEL_BEGIN_NAMESPACE
203 IMPKERNEL_END_NAMESPACE
Class for adding derivatives from restraints to the model.
static FloatKey get_radius_key()
Particle * get_particle() const
Sphere3D get_enclosing_sphere(const Sphere3Ds &ss)
Return a sphere containing the listed spheres.
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)
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.
Class to handle individual model particles.
const SphereD< D > & get_sphere_d_geometry(const SphereD< D > &g)
void set_sphere_d_geometry(SphereD< D > &g, const SphereD< D > &v)
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)
const BoundingBoxD< D > & get_bounding_box_d_geometry(const BoundingBoxD< D > &g)
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.
BoundingBoxD< D > get_bounding_box(const BoundingBoxD< D > &g)
A decorator for a particle with x,y,z coordinates and a radius.