9 #ifndef IMPEXAMPLE_RANDOMIZING_H
10 #define IMPEXAMPLE_RANDOMIZING_H
12 #include <IMP/example/example_config.h>
16 IMPEXAMPLE_BEGIN_NAMESPACE
18 template <
class Rig
idBody,
class BoundingVolume>
19 void randomize_rigid_body(RigidBody rbi,
const BoundingVolume &bv) {
20 core::RigidBody rb(rbi);
23 algebra::Transformation3D tr(rot, trans);
24 algebra::ReferenceFrame3D rf(tr);
25 rb.set_reference_frame(rf);
31 template <
class ParticlesList,
class BoundingVolume>
33 for (
unsigned int i = 0; i < ps.size(); ++i) {
36 if (core::RigidBody::get_is_setup(ps[i])) {
37 randomize_rigid_body(ps[i], bv);
41 }
else if (core::RigidMember::get_is_setup(ps[i])) {
49 IMPEXAMPLE_END_NAMESPACE
bool get_coordinates_are_optimized() const
Get whether the coordinates are optimized.
Rotation3D get_random_rotation_3d()
Pick a rotation at random from all possible rotations.
void set_coordinates(const algebra::Vector3D &v)
set all coordinates from a vector
functionality for defining rigid bodies
Functions to generate vectors.
VectorD< D > get_random_vector_in(const BoundingBoxD< D > &bb)
Generate a random vector in a box with uniform density.
A decorator for a particle with x,y,z coordinates.
void randomize_particles(const ParticlesList &ps, const BoundingVolume &bv)