10#define IMPCORE_XYZ_R_H
19IMPCORE_BEGIN_NAMESPACE
27class IMPCOREEXPORT XYZR :
public XYZ {
31 do_setup_particle(m, pi, s.get_radius());
40 if (!XYZ::get_is_setup(m, 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;
153IMP_PARTICLE_GEOMETRY(XYZDerivative,
core::XYZ, {
155 d.get_coordinates() + d.get_derivatives());
167IMP_PARTICLE_PAIR_GEOMETRY(EdgePair,
core::XYZ, {
ParticleIndex get_particle_index() const
Returns the particle index decorated by this decorator.
Model * get_model() const
Returns the Model containing the particle.
Particle * get_particle() const
Returns the particle decorated by this decorator.
Class for adding derivatives from restraints to the model.
Class for storing model, its restraints, constraints, and particles.
Simple implementation of segments in 3D.
A decorator for a particle with x,y,z coordinates and a radius.
static FloatKey get_radius_key()
Get the key for the radius.
void add_to_radius_derivative(double v, DerivativeAccumulator &d)
add v to the derivative of the radius attribute
void set_sphere(const algebra::Sphere3D &s)
Set the attributes from a sphere.
static bool get_is_setup(Model *m, ParticleIndex pi)
Check if the particle has the required attributes.
const algebra::Sphere3D & get_sphere() const
Return a sphere object.
A decorator for a particle with x,y,z coordinates.
static XYZ setup_particle(Model *m, ParticleIndex pi)
The base class for geometry.
#define IMP_DECORATOR_SETUP_1(Name, FirstArgumentType, first_argument_name)
#define IMP_DECORATOR_SETUP_0(Name)
#define IMP_DECORATORS(Name, PluralName, Parent)
Define the types for storing sets of decorators.
#define IMP_DECORATOR_METHODS(Name, Parent)
macros for display classes
SphereD< 3 > Sphere3D
Typedef for Python.
double get_distance(const Line3D &s, const Vector3D &p)
Get closest distance between a line and a point.
void set_enclosing_radius(XYZR b, const XYZs &v)
Set the radius of the first to enclose the list.
void set_enclosing_sphere(XYZR b, const XYZs &v, double slack=0)
Set the coordinates and radius of the first to enclose the list.
algebra::Sphere3D get_enclosing_sphere(const XYZs &v)
Get a sphere enclosing the set of XYZRs.
XYZRs create_xyzr_particles(Model *m, unsigned int num, Float radius, Float box_side=10)
Create a set of particles with random coordinates.
double get_distance(const Surface &s, const XYZR &d)
Get distance from sphere to surface.
Index< ParticleIndexTag > ParticleIndex
double Float
Basic floating-point value (could be float, double...).
Key< 0 > FloatKey
The type used to identify float attributes in the Particles.
Represent an XYZR particle with a sphere.
Implement geometry for the basic shapes from IMP.algebra.