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