9 #ifndef IMPMISC_CUSTOM_XYZ_R_H
10 #define IMPMISC_CUSTOM_XYZ_R_H
12 #include <IMP/misc/misc_config.h>
19 IMPMISC_BEGIN_NAMESPACE
27 if (!XYZ::get_is_setup(m, pi)) {
34 if (!XYZ::get_is_setup(m, pi)) {
55 FloatKey radius_key = get_default_radius_key()) {
68 set_radius(s.get_radius());
72 return IMP::internal::xyzr_keys[3];
75 get_particle()->add_to_derivative(get_decorator_traits(), v, d);
77 FloatKey get_traits() {
return get_decorator_traits(); }
#define IMP_DECORATOR_GET_SET(name, AttributeKey, Type, ReturnType)
Define methods for getting and setting a particular simple field.
SphereD< 3 > Sphere3D
Typedef for Python.
double get_distance(CustomXYZR a, CustomXYZR b)
Compute the distance between a pair of particles.
A decorator for a particle with x,y,z coordinates and a radius.
static FloatKey get_radius_key()
Get the key for the radius.
const algebra::Sphere3D get_sphere_d_geometry(CustomXYZR d)
static bool get_is_setup(Model *m, ParticleIndex pi, FloatKey radius_key=get_default_radius_key())
Check if the particle has the required attributes.
#define IMP_DECORATOR_TRAITS_SETUP_1(Name, FirstArgumentType,first_argument_name)
static XYZ setup_particle(Model *m, ParticleIndex pi)
Class for storing model, its restraints, constraints, and particles.
void set_sphere(const algebra::Sphere3D &s)
Set the attributes from a sphere.
void add_attribute(TypeKey attribute_key, ParticleIndex particle, Type value)
add particle attribute with the specified key and initial value
void set_coordinates(const algebra::Vector3D &v)
set all coordinates from a vector
#define IMP_DECORATOR_TRAITS_SETUP_0(Name)
algebra::Sphere3D get_sphere() const
Return a sphere object.
A decorator for a particle with x,y,z coordinates.
const algebra::Vector3D & get_coordinates() const
Convert it to a vector.
Particle * get_particle() const
Returns the particle decorated by this decorator.
#define IMP_DECORATOR_WITH_TRAITS_METHODS(Name, Parent, TraitsType,traits_name, default_traits)
void set_sphere_d_geometry(CustomXYZR d, const algebra::Sphere3D &v)
double Float
Basic floating-point value (could be float, double...)
#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
static FloatKey get_default_radius_key()
Get the default radius key.
Decorator for a sphere-like particle.
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.