#include <Iguana/Inventor/interface/IgSoG4Trap.h>
Public Member Functions | |
IgSoG4Trap (void) | |
Static Public Member Functions | |
static void | initClass (void) |
Public Attributes | |
SoSFFloat | alp1 |
SoSFFloat | alp2 |
SoSFFloat | dx1 |
SoSFFloat | dx2 |
SoSFFloat | dx3 |
SoSFFloat | dx4 |
SoSFFloat | dy1 |
SoSFFloat | dy2 |
SoSFFloat | dz |
SoSFFloat | phi |
SoSFFloat | theta |
Protected Member Functions | |
virtual void | refresh (void) |
Private Member Functions | |
SO_KIT_CATALOG_ENTRY_HEADER (faces) | |
SO_KIT_HEADER (IgSoG4Trap) |
Note that of the 11 parameters desribed below, only 9 are really independent - a check for planarity is made in the calculation of the equation for each plane. If the planes are not parallel, a call to G4Exception is made.
pDz Half-length along the z-axis pTheta Polar angle of the line joining the centres of the faces at -/+pDz pPhi Azimuthal angle of the line joing the centre of the face at -pDz to the centre of the face at +pDz pDy1 Half-length along y of the face at -pDz pDx1 Half-length along x of the side at y=-pDy1 of the face at -pDz pDx2 Half-length along x of the side at y=+pDy1 of the face at -pDz pAlp1 Angle with respect to the y axis from the centre of the side at y=-pDy1 to the centre at y=+pDy1 of the face at -pDz
pDy2 Half-length along y of the face at +pDz pDx3 Half-length along x of the side at y=-pDy2 of the face at +pDz pDx4 Half-length along x of the side at y=+pDy2 of the face at +pDz pAlp2 Angle with respect to the y axis from the centre of the side at y=-pDy2 to the centre at y=+pDy2 of the face at +pDz
Definition at line 54 of file IgSoG4Trap.h.
IgSoG4Trap::IgSoG4Trap | ( | void | ) |
Definition at line 24 of file IgSoG4Trap.cc.
References alp1, alp2, dx1, dx2, dx3, dx4, dy1, dy2, dz, FALSE, phi, IgSoShapeKit::setUpConnections(), theta, and TRUE.
00025 { 00026 SO_KIT_CONSTRUCTOR (IgSoG4Trap); 00027 SO_KIT_ADD_FIELD (dz, (1.0)); 00028 SO_KIT_ADD_FIELD (theta, (0.0)); 00029 SO_KIT_ADD_FIELD (phi, (0.0)); 00030 SO_KIT_ADD_FIELD (dy1, (1.0)); 00031 SO_KIT_ADD_FIELD (dx1, (1.0)); 00032 SO_KIT_ADD_FIELD (dx2, (1.0)); 00033 SO_KIT_ADD_FIELD (dy2, (1.0)); 00034 SO_KIT_ADD_FIELD (dx3, (1.0)); 00035 SO_KIT_ADD_FIELD (dx4, (1.0)); 00036 SO_KIT_ADD_FIELD (alp1, (0.0)); 00037 SO_KIT_ADD_FIELD (alp2, (0.0)); 00038 SO_KIT_ADD_CATALOG_ENTRY (faces, SoIndexedFaceSet, FALSE, separator,\x0, TRUE); 00039 SO_KIT_INIT_INSTANCE (); 00040 setUpConnections (true, true); 00041 }
Reimplemented from IgSoShapeKit.
Definition at line 21 of file IgSoG4Trap.cc.
Referenced by initNodes(), and initShapes().
00022 { SO_KIT_INIT_CLASS (IgSoG4Trap, IgSoShapeKit, "IgSoShapeKit"); }
Reimplemented from IgSoShapeKit.
Definition at line 44 of file IgSoG4Trap.cc.
References alp1, alp2, funct::cos(), dx1, dx2, dx3, dx4, dy1, dy2, dz, i, p1, p2, phi, funct::sin(), funct::tan(), and theta.
00045 { 00046 // FIXME: Only do non-zero faces 00047 static const int NPOINTS = 8; 00048 static const int NFACES = 6; 00049 static const int NINDICES = NFACES*5; 00050 00051 SoIndexedFaceSet *faces = new SoIndexedFaceSet; 00052 SoVertexProperty *vtx = new SoVertexProperty; 00053 float dy1TAlp1 = dy1.getValue () * tan (alp1.getValue ()); 00054 float dy2TAlp2 = dy2.getValue () * tan (alp2.getValue ()); 00055 float dzTThetaCPhi = dz.getValue () 00056 * tan (theta.getValue ()) 00057 * cos (phi.getValue ()); 00058 float dzTThetaSPhi = dz.getValue () 00059 * tan (theta.getValue ()) 00060 * sin (phi.getValue ()); 00061 static const int indices [NINDICES] = { 3,2,1,0, SO_END_FACE_INDEX, 00062 4,5,6,7, SO_END_FACE_INDEX, 00063 0,1,5,4, SO_END_FACE_INDEX, 00064 1,2,6,5, SO_END_FACE_INDEX, 00065 2,3,7,6, SO_END_FACE_INDEX, 00066 3,0,4,7, SO_END_FACE_INDEX }; 00067 float points [NPOINTS][3] = { 00068 { dx2.getValue ()+dy1TAlp1 - dzTThetaCPhi, dy1.getValue () - dzTThetaSPhi, -dz.getValue () }, 00069 { -dx2.getValue ()+dy1TAlp1 - dzTThetaCPhi, dy1.getValue () - dzTThetaSPhi, -dz.getValue () }, 00070 { -dx1.getValue ()-dy1TAlp1 - dzTThetaCPhi, -dy1.getValue () - dzTThetaSPhi, -dz.getValue () }, 00071 { dx1.getValue ()-dy1TAlp1 - dzTThetaCPhi, -dy1.getValue () - dzTThetaSPhi, -dz.getValue () }, 00072 { dx4.getValue ()+dy2TAlp2 + dzTThetaCPhi, dy2.getValue () + dzTThetaSPhi, dz.getValue () }, 00073 { -dx4.getValue ()+dy2TAlp2 + dzTThetaCPhi, dy2.getValue () + dzTThetaSPhi, dz.getValue () }, 00074 { -dx3.getValue ()-dy2TAlp2 + dzTThetaCPhi, -dy2.getValue () + dzTThetaSPhi, dz.getValue () }, 00075 { dx3.getValue ()-dy2TAlp2 + dzTThetaCPhi, -dy2.getValue () + dzTThetaSPhi, dz.getValue () } 00076 }; 00077 00078 for (int i = 0; i < NPOINTS; ++i) 00079 vtx->vertex.set1Value (i, points[i][0], points[i][1], points[i][2]); 00080 00081 for (int i = 0; i < 6; ++i) 00082 { 00083 SbVec3f p0 = vtx->vertex [indices [5*i + 0]]; 00084 SbVec3f p1 = vtx->vertex [indices [5*i + 1]]; 00085 SbVec3f p2 = vtx->vertex [indices [5*i + 2]]; 00086 SbVec3f normal = (p1-p0).cross (p2-p0); 00087 normal.normalize (); 00088 vtx->normal.set1Value (i, normal); 00089 } 00090 00091 vtx->normalBinding = SoVertexProperty::PER_FACE; 00092 faces->coordIndex.setValues (0, NINDICES, indices); 00093 faces->vertexProperty = vtx; 00094 00095 // Set parts 00096 setPart ("faces", faces); 00097 }
IgSoG4Trap::SO_KIT_CATALOG_ENTRY_HEADER | ( | faces | ) | [private] |
IgSoG4Trap::SO_KIT_HEADER | ( | IgSoG4Trap | ) | [private] |
SoSFFloat IgSoG4Trap::alp1 |
Definition at line 72 of file IgSoG4Trap.h.
Referenced by VisG4VisSceneHandler::AddSolid(), VisEventSetupService::addWafer(), VisTrackingGeometry::addWafer(), IgSoG4Trap(), and refresh().
SoSFFloat IgSoG4Trap::alp2 |
Definition at line 73 of file IgSoG4Trap.h.
Referenced by VisG4VisSceneHandler::AddSolid(), VisEventSetupService::addWafer(), VisTrackingGeometry::addWafer(), IgSoG4Trap(), and refresh().
SoSFFloat IgSoG4Trap::dx1 |
Definition at line 67 of file IgSoG4Trap.h.
Referenced by VisG4VisSceneHandler::AddSolid(), VisEventSetupService::addWafer(), VisTrackingGeometry::addWafer(), IgSoG4Trap(), and refresh().
SoSFFloat IgSoG4Trap::dx2 |
Definition at line 68 of file IgSoG4Trap.h.
Referenced by VisG4VisSceneHandler::AddSolid(), VisEventSetupService::addWafer(), VisTrackingGeometry::addWafer(), IgSoG4Trap(), and refresh().
SoSFFloat IgSoG4Trap::dx3 |
Definition at line 70 of file IgSoG4Trap.h.
Referenced by VisG4VisSceneHandler::AddSolid(), VisEventSetupService::addWafer(), VisTrackingGeometry::addWafer(), IgSoG4Trap(), and refresh().
SoSFFloat IgSoG4Trap::dx4 |
Definition at line 71 of file IgSoG4Trap.h.
Referenced by VisG4VisSceneHandler::AddSolid(), VisEventSetupService::addWafer(), VisTrackingGeometry::addWafer(), IgSoG4Trap(), and refresh().
SoSFFloat IgSoG4Trap::dy1 |
Definition at line 66 of file IgSoG4Trap.h.
Referenced by VisG4VisSceneHandler::AddSolid(), VisEventSetupService::addWafer(), VisTrackingGeometry::addWafer(), IgSoG4Trap(), and refresh().
SoSFFloat IgSoG4Trap::dy2 |
Definition at line 69 of file IgSoG4Trap.h.
Referenced by VisG4VisSceneHandler::AddSolid(), VisEventSetupService::addWafer(), VisTrackingGeometry::addWafer(), IgSoG4Trap(), and refresh().
SoSFFloat IgSoG4Trap::dz |
Definition at line 63 of file IgSoG4Trap.h.
Referenced by VisG4VisSceneHandler::AddSolid(), VisEventSetupService::addWafer(), VisTrackingGeometry::addWafer(), IgSoG4Trap(), and refresh().
SoSFFloat IgSoG4Trap::phi |
Definition at line 65 of file IgSoG4Trap.h.
Referenced by VisG4VisSceneHandler::AddSolid(), IgSoG4Trap(), and refresh().
SoSFFloat IgSoG4Trap::theta |
Definition at line 64 of file IgSoG4Trap.h.
Referenced by VisG4VisSceneHandler::AddSolid(), IgSoG4Trap(), and refresh().