5 #include "CLHEP/Vector/ThreeVector.h" 6 #include "CLHEP/Vector/Rotation.h" 7 #include "CLHEP/Geometry/Point3D.h" 8 #include "CLHEP/Geometry/Vector3D.h" 9 #include "CLHEP/Geometry/Normal3D.h" 16 Transform3D::Transform3D_row::Transform3D_row
17 (
const Transform3D & r,
int i) : rr(r), ii(i) {}
20 double Transform3D::Transform3D_row::operator[](
int jj)
const {
25 const Transform3D::Transform3D_row Transform3D::operator[](
int i)
const {
26 return Transform3D_row(*
this, i);
30 Transform3D::Transform3D(
const CLHEP::HepRotation & mt,
const CLHEP::Hep3Vector & v) {
31 xx_= mt.xx(); xy_= mt.xy(); xz_= mt.xz();
32 yx_= mt.yx(); yy_= mt.yy(); yz_= mt.yz();
33 zx_= mt.zx(); zy_= mt.zy(); zz_= mt.zz();
34 dx_= v.x(); dy_= v.y(); dz_= v.z();
39 Transform3D::getRotation()
const {
40 CLHEP::HepRotation mt;
41 return mt.rotateAxes(CLHEP::Hep3Vector(xx_,yx_,zx_),
42 CLHEP::Hep3Vector(xy_,yy_,zy_),
43 CLHEP::Hep3Vector(xz_,yz_,zz_));
48 Transform3D::getTranslation()
const {
49 return CLHEP::Hep3Vector(dx_,dy_,dz_);
55 Rotate3D::Rotate3D(
const CLHEP::HepRotation & mt) {
56 xx_= mt.xx(); xy_= mt.xy(); xz_= mt.xz();
57 yx_= mt.yx(); yy_= mt.yy(); yz_= mt.yz();
58 zx_= mt.zx(); zy_= mt.zy(); zz_= mt.zz();
59 dx_= 0; dy_= 0; dz_= 0;
63 Rotate3D::Rotate3D(
double a,
const Vector3D<double> & v) {
65 Rotate3D(a, Point3D<double>(0,0,0), Point3D<double>(v.x(),v.y(),v.z()));
69 Rotate3D::Rotate3D(
const Point3D<double> & fr1,
const Point3D<double> & fr2,
70 const Point3D<double> & to1,
const Point3D<double> & to2)
71 : Transform3D(Point3D<double>(0,0,0),fr1,fr2,
72 Point3D<double>(0,0,0),to1,to2) {}
77 Translate3D::Translate3D(
const CLHEP::Hep3Vector & v)
78 : Transform3D(1,0,0,v.x(), 0,1,0,v.y(), 0,0,1,v.z()) {}
83 Reflect3D::Reflect3D(
const Normal3D<double> & n,
const Point3D<double> & p) {
84 *
this = Reflect3D(n.x(), n.y(), n.z(), -n*p);