CLHEP 2.4.6.4
C++ Class Library for High Energy Physics
Loading...
Searching...
No Matches
Transform3D.h
Go to the documentation of this file.
1// -*- C++ -*-
2// $Id: Transform3D.h,v 1.5 2010/06/16 16:21:27 garren Exp $
3// ---------------------------------------------------------------------------
4//
5// This file is a part of the CLHEP - a Class Library for High Energy Physics.
6//
7// Hep geometrical 3D Transformation class
8//
9// Author: Evgeni Chernyaev <[email protected]>
10//
11// ******************************************
12// * *
13// * Transform *
14// * / / \ \ *
15// * -------- / \ -------- *
16// * / / \ \ *
17// * Rotate Translate Reflect Scale *
18// * / | \ / | \ / | \ / | \ *
19// * X Y Z X Y Z X Y Z X Y Z *
20// * *
21// ******************************************
22//
23// Identity transformation:
24// Transform3D::Identity - global identity transformation;
25// any constructor without parameters, e.g. Transform3D();
26// m.setIdentity() - set "m" to identity;
27//
28// General transformations:
29// Transform3D(m,v) - transformation given by Rotation "m"
30// and CLHEP::Hep3Vector "v";
31// Transform3D(a0,a1,a2, b0,b1,b2) - transformation given by initial
32// and transformed positions of three points;
33// Rotations:
34// Rotate3D(m) - rotation given by CLHEP::HepRotation "m";
35// Rotate3D(ang,v) - rotation through the angle "ang" around
36// vector "v";
37// Rotate3D(ang,p1,p2) - rotation through the angle "ang"
38// counterclockwise around the axis given by
39// two points p1->p2;
40// Rotate3D(a1,a2, b1,b2) - rotation around the origin defined by initial
41// and transformed positions of two points;
42// RotateX3D(ang) - rotation around X-axis;
43// RotateY3D(ang) - rotation around Y-axis;
44// RotateZ3D(ang) - rotation around Z-axis;
45//
46// Translations:
47// Translate3D(v) - translation given by CLHEP::Hep3Vector "v";
48// Translate3D(dx,dy,dz) - translation on vector (dx,dy,dz);
49// TraslateX3D(dx) - translation along X-axis;
50// TraslateY3D(dy) - translation along Y-axis;
51// TraslateZ3D(dz) - translation along Z-axis;
52//
53// Reflections:
54// Reflect3D(a,b,c,d) - reflection in the plane a*x+b*y+c*z+d=0;
55// Reflect3D(normal,p) - reflection in the plane going through "p"
56// and whose normal is equal to "normal";
57// ReflectX3D(a) - reflect X in the plane x=a (default a=0);
58// ReflectY3D(a) - reflect Y in the plane y=a (default a=0);
59// ReflectZ3D(a) - reflect Z in the plane z=a (default a=0);
60//
61// Scalings:
62// Scale3D(sx,sy,sz) - general scaling with factors "sx","sy","sz"
63// along X, Y and Z;
64// Scale3D(s) - scaling with constant factor "s" along all
65// directions;
66// ScaleX3D(sx) - scale X;
67// ScaleY3D(sy) - scale Y;
68// ScaleZ3D(sz) - scale Z;
69//
70// Inverse transformation:
71// m.inverse() or - returns inverse transformation;
72//
73// Compound transformation:
74// m3 = m2 * m1 - it is relatively slow in comparison with
75// transformation of a vector. Use parenthesis
76// to avoid this operation (see example below);
77// Transformation of point:
78// p2 = m * p1
79//
80// Transformation of vector:
81// v2 = m * v1
82//
83// Transformation of normal:
84// n2 = m * n1
85//
86// The following table explains how different transformations affect
87// point, vector and normal. "+" means affect, "-" means do not affect,
88// "*" meas affect but in different way than "+"
89//
90// Point Vector Normal
91// -------------+-------+-------+-------
92// Rotation ! + ! + ! +
93// Translation ! + ! - ! -
94// Reflection ! + ! + ! *
95// Scaling ! + ! + ! *
96// -------------+-------+-------+-------
97//
98// Example of the usage:
99//
100// Transform3D m1, m2, m3;
101// HepVector3D v2, v1(0,0,0);
102//
103// m1 = Rotate3D(angle, Vector3D(1,1,1));
104// m2 = Translate3D(dx,dy,dz);
105// m3 = m1.inverse();
106//
107// v2 = m3*(m2*(m1*v1));
108//
109// History:
110// 24.09.96 E.Chernyaev - initial version
111//
112// 26.02.97 E.Chernyaev
113// - added global Identity by request of John Allison
114// (to avoid problems with compilation on HP)
115// - added getRotation and getTranslation
116//
117// 29.01.01 E.Chernyaev - added subscripting
118// 11.06.01 E.Chernyaev - added getDecomposition
119
120#ifndef HEP_TRANSFROM3D_H
121#define HEP_TRANSFROM3D_H
122
123#include "CLHEP/Geometry/defs.h"
124#include "CLHEP/Vector/ThreeVector.h"
125
126namespace HepGeom {
127
128 template<class T> class Point3D;
129 template<class T> class Vector3D;
130 template<class T> class Normal3D;
131
132 class Translate3D;
133 class Rotate3D;
134 class Scale3D;
135
136 /**
137 * Class for transformation of 3D geometrical objects.
138 * It allows different translations, rotations, scalings and reflections.
139 * Several specialized classes are derived from it:
140 *
141 * TranslateX3D, TranslateY3D, TranslateZ3D, Translate3D,<br>
142 * RotateX3D, RotateY3D, RotateZ3D, Rotate3D, <br>
143 * ScaleX3D, ScaleY3D, ScaleZ3D, Scale3D, <br>
144 * ReflectX3D, ReflectY3D, ReflectZ3D, Reflect3D.
145 *
146 * The idea behind these classes is to provide some additional constructors
147 * for Transform3D, they normally should not be used as separate classes.
148 *
149 * Example:
150 * @code
151 * HepGeom::Transform3D m;
152 * m = HepGeom::TranslateX3D(10.*cm);
153 * @endcode
154 *
155 * Remark:
156 * For the reason that the operator* is left associative, the notation
157 * @code
158 * v2 = m3*(m2*(m1*v1));
159 * @endcode
160 * is much more effective then the notation
161 * @code
162 * v2 = m3*m2*m1*v1;
163 * @endcode
164 * In the first case three operations Transform3D*Vector3D are executed,
165 * in the second case two operations Transform3D*Transform3D and one
166 * Transform3D*Vector3D are performed. Transform3D*Transform3D is
167 * roughly three times slower than Transform3D*Vector3D.
168 *
169 * @author <[email protected]>
170 * @ingroup geometry
171 */
173 protected:
174 double xx_, xy_, xz_, dx_, // 4x3 Transformation Matrix
177
178 // Protected constructor
179 Transform3D(double XX, double XY, double XZ, double DX,
180 double YX, double YY, double YZ, double DY,
181 double ZX, double ZY, double ZZ, double DZ)
182 : xx_(XX), xy_(XY), xz_(XZ), dx_(DX),
183 yx_(YX), yy_(YY), yz_(YZ), dy_(DY),
184 zx_(ZX), zy_(ZY), zz_(ZZ), dz_(DZ) {}
185
186 // Set transformation matrix
187 void setTransform(double XX, double XY, double XZ, double DX,
188 double YX, double YY, double YZ, double DY,
189 double ZX, double ZY, double ZZ, double DZ) {
190 xx_ = XX; xy_ = XY; xz_ = XZ; dx_ = DX;
191 yx_ = YX; yy_ = YY; yz_ = YZ; dy_ = DY;
192 zx_ = ZX; zy_ = ZY; zz_ = ZZ; dz_ = DZ;
193 }
194
195 public:
196 /**
197 * Global identity transformation. */
198 static const Transform3D Identity;
199
200 // Helper class for implemention of C-style subscripting r[i][j]
202 public:
203 inline Transform3D_row(const Transform3D &, int);
204 inline double operator [] (int) const;
205 private:
206 const Transform3D & rr;
207 int ii;
208 };
209
210 /**
211 * Default constructor - sets the Identity transformation. */
213 : xx_(1), xy_(0), xz_(0), dx_(0),
214 yx_(0), yy_(1), yz_(0), dy_(0),
215 zx_(0), zy_(0), zz_(1), dz_(0) {}
216
217 /**
218 * Constructor: rotation and then translation. */
219 inline Transform3D(const CLHEP::HepRotation & mt, const CLHEP::Hep3Vector & v);
220
221 /**
222 * Constructor: transformation of basis (assumed - no reflection). */
223 Transform3D(const Point3D<double> & fr0,
224 const Point3D<double> & fr1,
225 const Point3D<double> & fr2,
226 const Point3D<double> & to0,
227 const Point3D<double> & to1,
228 const Point3D<double> & to2);
229
230 /**
231 * Copy constructor. */
232 Transform3D(const Transform3D & mt) = default;
233
234 /**
235 * Move constructor. */
236 Transform3D(Transform3D && mt) = default;
237
238 /**
239 * Destructor. */
240 ~Transform3D() = default;
241
242 /**
243 * Assignment. */
244 Transform3D & operator=(const Transform3D & mt) = default;
245
246 /**
247 * Move assignment. */
249
250 /**
251 * Returns object of the helper class for C-style subscripting r[i][j] */
252 inline const Transform3D_row operator [] (int) const;
253
254 /** Fortran-style subscripting: returns (i,j) element of the matrix. */
255 double operator () (int, int) const;
256
257 /**
258 * Gets xx-element of the transformation matrix. */
259 double xx() const { return xx_; }
260 /**
261 * Gets xy-element of the transformation matrix. */
262 double xy() const { return xy_; }
263 /**
264 * Gets xz-element of the transformation matrix. */
265 double xz() const { return xz_; }
266 /**
267 * Gets yx-element of the transformation matrix. */
268 double yx() const { return yx_; }
269 /**
270 * Gets yy-element of the transformation matrix. */
271 double yy() const { return yy_; }
272 /**
273 * Gets yz-element of the transformation matrix. */
274 double yz() const { return yz_; }
275 /**
276 * Gets zx-element of the transformation matrix. */
277 double zx() const { return zx_; }
278 /**
279 * Gets zy-element of the transformation matrix. */
280 double zy() const { return zy_; }
281 /**
282 * Gets zz-element of the transformation matrix. */
283 double zz() const { return zz_; }
284 /**
285 * Gets dx-element of the transformation matrix. */
286 double dx() const { return dx_; }
287 /**
288 * Gets dy-element of the transformation matrix. */
289 double dy() const { return dy_; }
290 /**
291 * Gets dz-element of the transformation matrix. */
292 double dz() const { return dz_; }
293
294 /**
295 * Sets the Identity transformation. */
296 void setIdentity() {
297 xy_= xz_= dx_= yx_= yz_= dy_= zx_= zy_= dz_= 0; xx_= yy_= zz_= 1;
298 }
299
300 /**
301 * Returns the inverse transformation. */
302 Transform3D inverse() const;
303
304 /**
305 * Transformation by another Transform3D. */
306 Transform3D operator*(const Transform3D & b) const;
307
308 /**
309 * Decomposition of general transformation.
310 * This function gets decomposition of the transformation
311 * in three consequentive specific transformations: Scale3D,
312 * then Rotate3D, then Translate3, i.e.
313 * @code
314 * Transform3D = Translate3D * Rotate3D * Scale3D
315 * @endcode
316 *
317 * @param scale output: scaling transformation;
318 * if there was a reflection, then scale factor for
319 * z-component (scale(2,2)) will be negative.
320 * @param rotation output: rotation transformaion.
321 * @param translation output: translation transformaion.
322 */
323 void getDecomposition(Scale3D & scale,
324 Rotate3D & rotation,
325 Translate3D & translation) const;
326
327 /**
328 * Returns true if the difference between corresponding
329 * matrix elements is less than the tolerance.
330 */
331 bool isNear(const Transform3D & t, double tolerance = 2.2E-14 ) const;
332
333 /**
334 * Extracts the rotation matrix.
335 * This functions is obsolete - use getDecomposition() instead.
336 */
338
339 /**
340 * Extracts the translation vector.
341 * This functions is obsolete - use getDecomposition() instead.
342 */
344
345 /**
346 * Test for equality. */
347 bool operator == (const Transform3D & transform) const;
348
349 /**
350 * Test for inequality. */
351 bool operator != (const Transform3D & transform) const {
352 return ! operator==(transform);
353 }
354 };
355
356 // R O T A T I O N S
357
358 /**
359 * Constructs a rotation transformation.
360 * This class provides additional constructors for Transform3D
361 * and should not be used as a separate class.
362 *
363 * Example of use:
364 * @code
365 * Transform3D m;
366 * m = Rotate3D(30.*deg, HepVector3D(1.,1.,1.));
367 * @endcode
368 *
369 * @author <[email protected]>
370 * @ingroup geometry
371 */
372 class Rotate3D : public Transform3D {
373 public:
374 /**
375 * Default constructor: sets the Identity transformation. */
377
378 /**
379 * Constructor from CLHEP::HepRotation. */
380 inline Rotate3D(const CLHEP::HepRotation &mt);
381
382 /**
383 * Constructor from angle and axis given by two points.
384 * @param a angle of rotation
385 * @param p1 begin point of the axis
386 * @param p2 end point of the axis
387 */
388 Rotate3D(double a,
389 const Point3D<double> & p1,
390 const Point3D<double> & p2);
391
392 /**
393 * Constructor from angle and axis.
394 * @param a angle of rotation
395 * @param v axis of rotation
396 */
397 inline Rotate3D(double a, const Vector3D<double> & v);
398
399 /**
400 * Constructor for rotation given by original and rotated position of
401 * two points. It is assumed that there is no reflection.
402 * @param fr1 original position of 1st point
403 * @param fr2 original position of 2nd point
404 * @param to1 rotated position of 1st point
405 * @param to2 rotated position of 2nd point
406 */
407 inline Rotate3D(const Point3D<double> & fr1,
408 const Point3D<double> & fr2,
409 const Point3D<double> & to1,
410 const Point3D<double> & to2);
411 };
412
413 /**
414 * Constructs a rotation around x-axis.
415 * This class provides additional constructors for Transform3D
416 * and should not be used as a separate class.
417 *
418 * Example of use:
419 * @code
420 * Transform3D m;
421 * m = RotateX3D(30.*deg);
422 * @endcode
423 *
424 * @author <[email protected]>
425 * @ingroup geometry
426 */
427 class RotateX3D : public Rotate3D {
428 public:
429 /**
430 * Default constructor: sets the Identity transformation. */
432
433 /**
434 * Constructs a rotation around x-axis by angle a. */
435 RotateX3D(double a) {
436 double cosa = std::cos(a), sina = std::sin(a);
437 setTransform(1,0,0,0, 0,cosa,-sina,0, 0,sina,cosa,0);
438 }
439 };
440
441 /**
442 * Constructs a rotation around y-axis.
443 * This class provides additional constructors for Transform3D
444 * and should not be used as a separate class.
445 *
446 * Example of use:
447 * @code
448 * Transform3D m;
449 * m = RotateY3D(30.*deg);
450 * @endcode
451 *
452 * @author <[email protected]>
453 * @ingroup geometry
454 */
455 class RotateY3D : public Rotate3D {
456 public:
457 /**
458 * Default constructor: sets the Identity transformation. */
460
461 /**
462 * Constructs a rotation around y-axis by angle a. */
463 RotateY3D(double a) {
464 double cosa = std::cos(a), sina = std::sin(a);
465 setTransform(cosa,0,sina,0, 0,1,0,0, -sina,0,cosa,0);
466 }
467 };
468
469 /**
470 * Constructs a rotation around z-axis.
471 * This class provides additional constructors for Transform3D
472 * and should not be used as a separate class.
473 *
474 * Example of use:
475 * @code
476 * Transform3D m;
477 * m = RotateZ3D(30.*deg);
478 * @endcode
479 *
480 * @author <[email protected]>
481 * @ingroup geometry
482 */
483 class RotateZ3D : public Rotate3D {
484 public:
485 /**
486 * Default constructor: sets the Identity transformation. */
488
489 /**
490 * Constructs a rotation around z-axis by angle a. */
491 RotateZ3D(double a) {
492 double cosa = std::cos(a), sina = std::sin(a);
493 setTransform(cosa,-sina,0,0, sina,cosa,0,0, 0,0,1,0);
494 }
495 };
496
497 // T R A N S L A T I O N S
498
499 /**
500 * Constructs a translation transformation.
501 * This class provides additional constructors for Transform3D
502 * and should not be used as a separate class.
503 *
504 * Example of use:
505 * @code
506 * Transform3D m;
507 * m = Translate3D(10.,20.,30.);
508 * @endcode
509 *
510 * @author <[email protected]>
511 * @ingroup geometry
512 */
513 class Translate3D : public Transform3D {
514 public:
515 /**
516 * Default constructor: sets the Identity transformation. */
518
519 /**
520 * Constructor from CLHEP::Hep3Vector. */
522
523 /**
524 * Constructor from three numbers. */
525 Translate3D(double x, double y, double z)
526 : Transform3D(1,0,0,x, 0,1,0,y, 0,0,1,z) {}
527 };
528
529 /**
530 * Constructs a translation along x-axis.
531 * This class provides additional constructors for Transform3D
532 * and should not be used as a separate class.
533 *
534 * Example of use:
535 * @code
536 * Transform3D m;
537 * m = TranslateX3D(10.);
538 * @endcode
539 *
540 * @author <[email protected]>
541 * @ingroup geometry
542 */
543 class TranslateX3D : public Translate3D {
544 public:
545 /**
546 * Default constructor: sets the Identity transformation. */
548
549 /**
550 * Constructor from a number. */
551 TranslateX3D(double x) : Translate3D(x, 0, 0) {}
552 };
553
554 /**
555 * Constructs a translation along y-axis.
556 * This class provides additional constructors for Transform3D
557 * and should not be used as a separate class.
558 *
559 * Example of use:
560 * @code
561 * Transform3D m;
562 * m = TranslateY3D(10.);
563 * @endcode
564 *
565 * @author <[email protected]>
566 * @ingroup geometry
567 */
568 class TranslateY3D : public Translate3D {
569 public:
570 /**
571 * Default constructor: sets the Identity transformation. */
573
574 /**
575 * Constructor from a number. */
576 TranslateY3D(double y) : Translate3D(0, y, 0) {}
577 };
578
579 /**
580 * Constructs a translation along z-axis.
581 * This class provides additional constructors for Transform3D
582 * and should not be used as a separate class.
583 *
584 * Example of use:
585 * @code
586 * Transform3D m;
587 * m = TranslateZ3D(10.);
588 * @endcode
589 *
590 * @author <[email protected]>
591 * @ingroup geometry
592 */
593 class TranslateZ3D : public Translate3D {
594 public:
595 /**
596 * Default constructor: sets the Identity transformation. */
598
599 /**
600 * Constructor from a number. */
601 TranslateZ3D(double z) : Translate3D(0, 0, z) {}
602 };
603
604 // R E F L E C T I O N S
605
606 /**
607 * Constructs a reflection transformation.
608 * This class provides additional constructors for Transform3D
609 * and should not be used as a separate class.
610 *
611 * Example of use:
612 * @code
613 * Transform3D m;
614 * m = Reflect3D(1.,1.,1.,0.);
615 * @endcode
616 *
617 * @author <[email protected]>
618 * @ingroup geometry
619 */
620 class Reflect3D : public Transform3D {
621 protected:
622 Reflect3D(double XX, double XY, double XZ, double DX,
623 double YX, double YY, double YZ, double DY,
624 double ZX, double ZY, double ZZ, double DZ)
625 : Transform3D(XX,XY,XZ,DX, YX,YY,YZ,DY, ZX,ZY,ZZ,DZ) {}
626
627 public:
628 /**
629 * Default constructor: sets the Identity transformation. */
631
632 /**
633 * Constructor from four numbers.
634 * Sets reflection in a plane a*x+b*y+c*z+d=0
635 */
636 Reflect3D(double a, double b, double c, double d);
637
638 /**
639 * Constructor from a plane given by its normal and origin. */
640 inline Reflect3D(const Normal3D<double> & normal,
641 const Point3D<double> & point);
642 };
643
644 /**
645 * Constructs reflection in a plane x=const.
646 * This class provides additional constructors for Transform3D
647 * and should not be used as a separate class.
648 *
649 * Example of use:
650 * @code
651 * Transform3D m;
652 * m = ReflectX3D(1.);
653 * @endcode
654 *
655 * @author <[email protected]>
656 * @ingroup geometry
657 */
658 class ReflectX3D : public Reflect3D {
659 public:
660 /**
661 * Constructor from a number. */
662 ReflectX3D(double x=0) : Reflect3D(-1,0,0,x+x, 0,1,0,0, 0,0,1,0) {}
663 };
664
665 /**
666 * Constructs reflection in a plane y=const.
667 * This class provides additional constructors for Transform3D
668 * and should not be used as a separate class.
669 *
670 * Example of use:
671 * @code
672 * Transform3D m;
673 * m = ReflectY3D(1.);
674 * @endcode
675 *
676 * @author <[email protected]>
677 * @ingroup geometry
678 */
679 class ReflectY3D : public Reflect3D {
680 public:
681 /**
682 * Constructor from a number. */
683 ReflectY3D(double y=0) : Reflect3D(1,0,0,0, 0,-1,0,y+y, 0,0,1,0) {}
684 };
685
686 /**
687 * Constructs reflection in a plane z=const.
688 * This class provides additional constructors for Transform3D
689 * and should not be used as a separate class.
690 *
691 * Example of use:
692 * @code
693 * Transform3D m;
694 * m = ReflectZ3D(1.);
695 * @endcode
696 *
697 * @author <[email protected]>
698 * @ingroup geometry
699 */
700 class ReflectZ3D : public Reflect3D {
701 public:
702 /**
703 * Constructor from a number. */
704 ReflectZ3D(double z=0) : Reflect3D(1,0,0,0, 0,1,0,0, 0,0,-1,z+z) {}
705 };
706
707 // S C A L I N G S
708
709 /**
710 * Constructs a scaling transformation.
711 * This class provides additional constructors for Transform3D
712 * and should not be used as a separate class.
713 *
714 * Example of use:
715 * @code
716 * Transform3D m;
717 * m = Scale3D(2.);
718 * @endcode
719 *
720 * @author <[email protected]>
721 * @ingroup geometry
722 */
723 class Scale3D : public Transform3D {
724 public:
725 /**
726 * Default constructor: sets the Identity transformation. */
728
729 /**
730 * Constructor from three numbers - scale factors in different directions.
731 */
732 Scale3D(double x, double y, double z)
733 : Transform3D(x,0,0,0, 0,y,0,0, 0,0,z,0) {}
734
735 /**
736 * Constructor from a number: sets uniform scaling in all directions. */
737 Scale3D(double sc)
738 : Transform3D(sc,0,0,0, 0,sc,0,0, 0,0,sc,0) {}
739 };
740
741 /**
742 * Constructs a scaling transformation in x-direction.
743 * This class provides additional constructors for Transform3D
744 * and should not be used as a separate class.
745 *
746 * Example of use:
747 * @code
748 * Transform3D m;
749 * m = ScaleX3D(2.);
750 * @endcode
751 *
752 * @author <[email protected]>
753 * @ingroup geometry
754 */
755 class ScaleX3D : public Scale3D {
756 public:
757 /**
758 * Default constructor: sets the Identity transformation. */
760
761 /**
762 * Constructor from a number (scale factor in x-direction). */
763 ScaleX3D(double x) : Scale3D(x, 1, 1) {}
764 };
765
766 /**
767 * Constructs a scaling transformation in y-direction.
768 * This class provides additional constructors for Transform3D
769 * and should not be used as a separate class.
770 *
771 * Example of use:
772 * @code
773 * Transform3D m;
774 * m = ScaleY3D(2.);
775 * @endcode
776 *
777 * @author <[email protected]>
778 * @ingroup geometry
779 */
780 class ScaleY3D : public Scale3D {
781 public:
782 /**
783 * Default constructor: sets the Identity transformation. */
785
786 /**
787 * Constructor from a number (scale factor in y-direction). */
788 ScaleY3D(double y) : Scale3D(1, y, 1) {}
789 };
790
791 /**
792 * Constructs a scaling transformation in z-direction.
793 * This class provides additional constructors for Transform3D
794 * and should not be used as a separate class.
795 *
796 * Example of use:
797 * @code
798 * Transform3D m;
799 * m = ScaleZ3D(2.);
800 * @endcode
801 *
802 * @author <[email protected]>
803 * @ingroup geometry
804 */
805 class ScaleZ3D : public Scale3D {
806 public:
807 /**
808 * Default constructor: sets the Identity transformation. */
810 /**
811 * Constructor from a number (scale factor in z-direction). */
812 ScaleZ3D(double z) : Scale3D(1, 1, z) {}
813 };
814} /* namespace HepGeom */
815
816#ifdef ENABLE_BACKWARDS_COMPATIBILITY
817// backwards compatibility will be enabled ONLY in CLHEP 1.9
818typedef HepGeom::Transform3D HepTransform3D;
819typedef HepGeom::Rotate3D HepRotate3D;
820typedef HepGeom::RotateX3D HepRotateX3D;
821typedef HepGeom::RotateY3D HepRotateY3D;
822typedef HepGeom::RotateZ3D HepRotateZ3D;
823typedef HepGeom::Translate3D HepTranslate3D;
824typedef HepGeom::TranslateX3D HepTranslateX3D;
825typedef HepGeom::TranslateY3D HepTranslateY3D;
826typedef HepGeom::TranslateZ3D HepTranslateZ3D;
827typedef HepGeom::Reflect3D HepReflect3D;
828typedef HepGeom::ReflectX3D HepReflectX3D;
829typedef HepGeom::ReflectY3D HepReflectY3D;
830typedef HepGeom::ReflectZ3D HepReflectZ3D;
831typedef HepGeom::Scale3D HepScale3D;
832typedef HepGeom::ScaleX3D HepScaleX3D;
833typedef HepGeom::ScaleY3D HepScaleY3D;
834typedef HepGeom::ScaleZ3D HepScaleZ3D;
835#endif
836
837#include "CLHEP/Geometry/Transform3D.icc"
838
839#endif /* HEP_TRANSFROM3D_H */
Reflect3D(const Normal3D< double > &normal, const Point3D< double > &point)
Reflect3D(double XX, double XY, double XZ, double DX, double YX, double YY, double YZ, double DY, double ZX, double ZY, double ZZ, double DZ)
Definition: Transform3D.h:622
ReflectX3D(double x=0)
Definition: Transform3D.h:662
ReflectY3D(double y=0)
Definition: Transform3D.h:683
ReflectZ3D(double z=0)
Definition: Transform3D.h:704
Rotate3D(double a, const Vector3D< double > &v)
Rotate3D(const Point3D< double > &fr1, const Point3D< double > &fr2, const Point3D< double > &to1, const Point3D< double > &to2)
Rotate3D(const CLHEP::HepRotation &mt)
RotateX3D(double a)
Definition: Transform3D.h:435
RotateY3D(double a)
Definition: Transform3D.h:463
RotateZ3D(double a)
Definition: Transform3D.h:491
Scale3D(double sc)
Definition: Transform3D.h:737
Scale3D(double x, double y, double z)
Definition: Transform3D.h:732
ScaleX3D(double x)
Definition: Transform3D.h:763
ScaleY3D(double y)
Definition: Transform3D.h:788
ScaleZ3D(double z)
Definition: Transform3D.h:812
Transform3D_row(const Transform3D &, int)
double operator()(int, int) const
Definition: Transform3D.cc:25
static const Transform3D Identity
Definition: Transform3D.h:198
double dy() const
Definition: Transform3D.h:289
bool isNear(const Transform3D &t, double tolerance=2.2E-14) const
Definition: Transform3D.cc:205
Transform3D operator*(const Transform3D &b) const
Definition: Transform3D.cc:53
Transform3D & operator=(Transform3D &&mt)=default
double zz() const
Definition: Transform3D.h:283
double yz() const
Definition: Transform3D.h:274
bool operator==(const Transform3D &transform) const
Definition: Transform3D.cc:222
double dz() const
Definition: Transform3D.h:292
bool operator!=(const Transform3D &transform) const
Definition: Transform3D.h:351
CLHEP::HepRotation getRotation() const
double dx() const
Definition: Transform3D.h:286
void getDecomposition(Scale3D &scale, Rotate3D &rotation, Translate3D &translation) const
Definition: Transform3D.cc:175
double xy() const
Definition: Transform3D.h:262
CLHEP::Hep3Vector getTranslation() const
const Transform3D_row operator[](int) const
void setTransform(double XX, double XY, double XZ, double DX, double YX, double YY, double YZ, double DY, double ZX, double ZY, double ZZ, double DZ)
Definition: Transform3D.h:187
double zx() const
Definition: Transform3D.h:277
Transform3D(const Transform3D &mt)=default
double yx() const
Definition: Transform3D.h:268
Transform3D(const CLHEP::HepRotation &mt, const CLHEP::Hep3Vector &v)
Transform3D inverse() const
Definition: Transform3D.cc:143
double zy() const
Definition: Transform3D.h:280
double xx() const
Definition: Transform3D.h:259
Transform3D & operator=(const Transform3D &mt)=default
double yy() const
Definition: Transform3D.h:271
Transform3D(double XX, double XY, double XZ, double DX, double YX, double YY, double YZ, double DY, double ZX, double ZY, double ZZ, double DZ)
Definition: Transform3D.h:179
double xz() const
Definition: Transform3D.h:265
Transform3D(Transform3D &&mt)=default
Translate3D(double x, double y, double z)
Definition: Transform3D.h:525
Translate3D(const CLHEP::Hep3Vector &v)