9 #ifndef IMPCORE_XYZ_R_H
10 #define IMPCORE_XYZ_R_H
18 IMPCORE_BEGIN_NAMESPACE
26 class IMPCOREEXPORT
XYZR:
36 if (!XYZ::particle_is_instance(p)) {
37 XYZ::setup_particle(p);
39 p->add_attribute(get_radius_key(), 0,
false);
51 p->add_attribute(get_radius_key(), radius,
false);
60 const algebra::Sphere3D &s) {
61 XYZ::setup_particle(p, s.get_center());
62 p->add_attribute(get_radius_key(), s.get_radius(),
false);
68 return p->has_attribute(get_radius_key());
70 double get_radius()
const {
71 return get_sphere().get_radius();
73 void set_radius(
double r)
const {
74 get_model()->get_sphere(get_particle_index())[3]=r;
79 const algebra::Sphere3D& get_sphere()
const {
80 return get_model()->get_sphere(get_particle_index());
84 void set_sphere(
const algebra::Sphere3D &s) {
89 return IMP::internal::xyzr_keys[3];
91 void add_to_radius_derivative(
double v,
93 get_particle()->add_to_derivative(get_radius_key(), v, d);
180 if (display::Colored::particle_is_instance(d)) {
189 IMP_PARTICLE_GEOMETRY(XYZDerivative,
core::XYZ, {
204 IMP_PARTICLE_PAIR_GEOMETRY(EdgePair,
core::XYZ, {
207 d1.get_coordinates())));
210 IMPCORE_END_NAMESPACE