11 #include <IMP/core/core_config.h>
19 IMPCORE_BEGIN_NAMESPACE
31 static void do_setup_particle(
44 static FloatKey get_coordinate_key(
unsigned int i) {
46 return IMP::internal::xyzr_keys[i];
76 get_particle()->add_to_derivative(get_coordinate_key(i), v, d);
87 return get_particle()->get_is_optimized(get_coordinate_key(0)) &&
88 get_particle()->get_is_optimized(get_coordinate_key(1)) &&
93 get_particle()->set_is_optimized(get_coordinate_key(0), tf);
94 get_particle()->set_is_optimized(get_coordinate_key(1), tf);
95 get_particle()->set_is_optimized(get_coordinate_key(2), tf);
118 return m->get_has_attribute(get_coordinate_key(2), pi);
136 IMPCORE_END_NAMESPACE
141 IMPKERNEL_BEGIN_NAMESPACE
153 return core::XYZ(d).get_coordinates();
161 WeakPointer<Particle> d) {
162 return core::XYZ(d).get_coordinates();
170 Pointer<Particle> d) {
171 return core::XYZ(d).get_coordinates();
178 IMPKERNEL_END_NAMESPACE
182 IMPCORE_BEGIN_NAMESPACE
197 IMPCOREEXPORT
double get_dihedral(XYZ a, XYZ b, XYZ c, XYZ d);
207 IMPCORE_END_NAMESPACE
The base class for decorators.
void add_to_derivatives(const algebra::Vector3D &v, DerivativeAccumulator &d)
Add something to the derivative of the coordinates.
#define IMP_DECORATOR_GET_SET(name, AttributeKey, Type, ReturnType)
Define methods for getting and setting a particular simple field.
ParticleIndex get_particle_index() const
Returns the particle index decorated by this decorator.
Smart pointer to Object-derived classes that does not refcount.
#define IMP_DECORATOR_SETUP_1(Name, FirstArgumentType, first_argument_name)
double get_dihedral(XYZ a, XYZ b, XYZ c, XYZ d)
Compute the dihedral angle (in radians) between the four particles.
Model * get_model() const
Returns the Model containing the particle.
bool get_coordinates_are_optimized() const
Get whether the coordinates are optimized.
void set_coordinate(unsigned int i, Float v)
set the ith coordinate
void set_vector_geometry(Pointer< Particle > d, const algebra::Vector3D &v)
A smart pointer to a reference counted object.
Class for storing model, its restraints, constraints, and particles.
Float get_derivative(int i) const
Get the ith coordinate derivative.
void add_attribute(TypeKey attribute_key, ParticleIndex particle, Type value)
void set_coordinates(const algebra::Vector3D &v)
set all coordinates from a vector
void transform(XYZ a, const algebra::Transformation3D &tr)
Apply a transformation to the particle.
double get_distance(XYZ a, XYZ b)
Compute the distance between a pair of particles.
Various general useful macros for IMP.
A decorator for a particle with x,y,z coordinates.
Float get_coordinate(int i) const
Get the ith coordinate.
#define IMP_DECORATOR_SETUP_0(Name)
const algebra::Vector3D & get_coordinates() const
Convert it to a vector.
algebra::Vector3D get_vector_to(const XYZ &b) const
Get the vector from this particle to another.
Particle * get_particle() const
Returns the particle decorated by this decorator.
Interface to specialized Particle types (e.g. atoms)
void set_coordinates_are_optimized(bool tf) const
Set whether the coordinates are optimized.
algebra::Vector3D get_derivatives() const
Get the vector of derivatives.
#define IMP_DECORATOR_METHODS(Name, Parent)
double Float
Basic floating-point value (could be float, double...)
Class to handle individual model particles.
#define IMP_USAGE_CHECK(expr, message)
A runtime test for incorrect usage of a class or method.
#define IMP_DECORATORS(Name, PluralName, Parent)
Define the types for storing sets of decorators.
void add_to_derivative(int i, Float v, DerivativeAccumulator &d)
Add something to the derivative of the ith coordinate.
Class for adding derivatives from restraints to the model.