9 #ifndef IMPALGEBRA_TRANSFORMATION_3D_H
10 #define IMPALGEBRA_TRANSFORMATION_3D_H
12 #include <IMP/algebra/algebra_config.h>
19 IMPALGEBRA_BEGIN_NAMESPACE
21 #if !defined(IMP_DOXYGEN) && !defined(SWIG)
22 class Transformation3D;
23 Transformation3D
compose(
const Transformation3D &a,
const Transformation3D &b);
26 typedef std::pair<Vector4D, Vector3D> Transformation3DAdjoint;
27 typedef std::pair<Vector3D, Transformation3DAdjoint> TransformedVector3DAdjoint;
28 typedef std::pair<Transformation3DAdjoint, Transformation3DAdjoint>
29 ComposeTransformation3DAdjoint;
43 : trans_(t), rot_(r) {}
50 return rot_.get_rotated(o) + trans_;
60 Vector3D *Dv, Transformation3DAdjoint *DT)
const;
68 TransformedVector3DAdjoint
105 out <<
" || " << trans_;
107 Transformation3D get_inverse()
const;
114 return rot_.get_is_valid();
149 "composing an invalid transformation");
159 IMPALGEBRAEXPORT
void
160 compose_adjoint(
const Transformation3D &TA,
const Transformation3D &TB,
161 const Transformation3DAdjoint &DTC,
162 Transformation3DAdjoint *DTA, Transformation3DAdjoint *DTB);
169 IMPALGEBRAEXPORT ComposeTransformation3DAdjoint
170 compose_adjoint(
const Transformation3D &TA,
const Transformation3D &TB,
171 const Transformation3DAdjoint &DTC);
173 class Transformation2D;
180 IMPALGEBRAEXPORT Transformation3D
191 IMPALGEBRAEXPORT Transformation3D
193 double max_translation = 5.,
194 double max_angle_in_rad = 0.26);
200 for (
unsigned int i = 0; i < 2; ++i) {
201 for (
unsigned int j = 0; j < 2; ++j) {
202 for (
unsigned int k = 0; k < 2; ++k) {
213 const Transformation3D &tr) {
214 return Line3D(tr.get_rotation().get_rotated(l.
get_direction()),
218 IMPALGEBRA_END_NAMESPACE
Base class for geometric types.
Simple implementation of lines in 3D.
#define IMP_SHOWABLE_INLINE(Name, how_to_show)
Declare the methods needed by an object that can be printed.
const VectorD< D > & get_corner(unsigned int i) const
For 0 return lower corner and for 1, the upper corner.
Simple implementation of lines in 3D.
Rotation2D compose(const Rotation2D &a, const Rotation2D &b)
Compose two rotations a and b.
Vector3D get_point_on_line() const
Get the point on the line closest to the origin.
Transformation3D get_rotation_about_point(const Vector3D &point, const Rotation3D &rotation)
Generate a Transformation3D object from a rotation around a point.
#define IMP_VALUES(Name, PluralName)
Define the type for storing sets of values.
Base class for geometric types.
A bounding box in D dimensions.
Transformation3D compose(const Transformation3D &a, const Transformation3D &b)
Compose two transformations.
Simple 3D rotation class.
Transformation3D get_identity_transformation_3d()
Return a transformation that does not do anything.
Transformation3D get_transformation_3d(const Transformation2D &t2d)
Build a 3D transformation from a 2D one.
const Vector3D & get_direction() const
Get the unit vector in the direction of the line.
Rotation3D get_identity_rotation_3d()
Return a rotation that does not do anything.
ComposeTransformation3DAdjoint compose_adjoint(const Transformation3D &TA, const Transformation3D &TB, const Transformation3DAdjoint &DTC)
Get adjoint of inputs to compose from adjoint of output.
#define IMP_USAGE_CHECK(expr, message)
A runtime test for incorrect usage of a class or method.
DensityMap * get_transformed(const DensityMap *input, const algebra::Transformation3D &tr, double threshold)
Return a new density map containing a rotated version of the old one.
Transformation3D get_random_local_transformation(Vector3D origin, double max_translation=5., double max_angle_in_rad=0.26)
Get a local transformation.