Geant4 Cross Reference |
>> 1 // This code implementation is the intellectual property of >> 2 // the GEANT4 collaboration. 1 // 3 // 2 // ******************************************* << 4 // By copying, distributing or modifying the Program (or any work 3 // * License and Disclaimer << 5 // based on the Program) you indicate your acceptance of this statement, 4 // * << 6 // and all its terms. 5 // * The Geant4 software is copyright of th << 6 // * the Geant4 Collaboration. It is provided << 7 // * conditions of the Geant4 Software License << 8 // * LICENSE and available at http://cern.ch/ << 9 // * include a list of copyright holders. << 10 // * << 11 // * Neither the authors of this software syst << 12 // * institutes,nor the agencies providing fin << 13 // * work make any representation or warran << 14 // * regarding this software system or assum << 15 // * use. Please see the license in the file << 16 // * for the full disclaimer and the limitatio << 17 // * << 18 // * This code implementation is the result << 19 // * technical work of the GEANT4 collaboratio << 20 // * By using, copying, modifying or distri << 21 // * any work based on the software) you ag << 22 // * use in resulting scientific publicati << 23 // * acceptance of all terms of the Geant4 Sof << 24 // ******************************************* << 25 // << 26 // 7 // >> 8 // $Id: G4OpenInventorTransform3D.cc,v 1.3 1999/12/15 14:54:12 gunter Exp $ >> 9 // GEANT4 tag $Name: geant4-03-01 $ 27 // 10 // 28 // 11 // 29 // jck 17 Dec 1996 12 // jck 17 Dec 1996 30 // G4OpenInventorTransform3D provides OpenGL s 13 // G4OpenInventorTransform3D provides OpenGL style transformation matrix 31 // from G4Transform3D. 14 // from G4Transform3D. 32 // gb 22 Nov 2004 : use SbMatrix instead of So << 33 15 34 // this : << 16 #ifdef G4VIS_BUILD_OI_DRIVER 35 #include "G4OpenInventorTransform3D.hh" << 36 17 37 #include <Inventor/SbLinear.h> << 18 #include <Inventor/fields/SoSFMatrix.h> >> 19 >> 20 #include "G4OpenInventorTransform3D.hh" 38 21 39 G4OpenInventorTransform3D::G4OpenInventorTrans 22 G4OpenInventorTransform3D::G4OpenInventorTransform3D (const G4Transform3D &t) 40 : G4Transform3D (t) { 23 : G4Transform3D (t) { 41 #define elem(i,j) ((float)t(i,j)) << 24 m[0] = xx; 42 m[0] = elem(0,0); //xx << 25 m[1] = yx; 43 m[1] = elem(1,0); //yx << 26 m[2] = zx; 44 m[2] = elem(2,0); //zx << 45 m[3] = 0; 27 m[3] = 0; 46 m[4] = elem(0,1); //xy << 28 m[4] = xy; 47 m[5] = elem(1,1); //yy << 29 m[5] = yy; 48 m[6] = elem(2,1); //zy << 30 m[6] = zy; 49 m[7] = 0; 31 m[7] = 0; 50 m[8] = elem(0,2); //xz << 32 m[8] = xz; 51 m[9] = elem(1,2); //yz << 33 m[9] = yz; 52 m[10] = elem(2,2); //zz << 34 m[10] = zz; 53 m[11] = 0; 35 m[11] = 0; 54 m[12] = elem(0,3); //dx << 36 m[12] = dx; 55 m[13] = elem(1,3); //dy << 37 m[13] = dy; 56 m[14] = elem(2,3); //dz << 38 m[14] = dz; 57 m[15] = 1; 39 m[15] = 1; 58 #undef elem << 59 } 40 } 60 41 61 SbMatrix* G4OpenInventorTransform3D::GetSbMatr << 42 SoSFMatrix* G4OpenInventorTransform3D::GetOIMatrix () const { 62 SbMatrix* tm = new SbMatrix(m[0],m[1],m[2],m << 43 SoSFMatrix *tm = new SoSFMatrix; 63 m[4],m[5],m[6],m << 44 tm->setValue(m[0],m[1],m[2],m[3], 64 m[8],m[9],m[10], << 45 m[4],m[5],m[6],m[7], 65 m[12],m[13],m[14 << 46 m[8],m[9],m[10],m[11], >> 47 m[12],m[13],m[14],m[15]); 66 return tm; 48 return tm; 67 } 49 } >> 50 >> 51 #endif 68 52