#include <G4ParameterisationPolyhedra.hh>
Inheritance diagram for G4VParameterisationPolyhedra:
Public Member Functions | |
G4VParameterisationPolyhedra (EAxis axis, G4int nCopies, G4double offset, G4double step, G4VSolid *msolid, DivisionType divType) | |
virtual | ~G4VParameterisationPolyhedra () |
Definition at line 64 of file G4ParameterisationPolyhedra.hh.
G4VParameterisationPolyhedra::G4VParameterisationPolyhedra | ( | EAxis | axis, | |
G4int | nCopies, | |||
G4double | offset, | |||
G4double | step, | |||
G4VSolid * | msolid, | |||
DivisionType | divType | |||
) |
Definition at line 49 of file G4ParameterisationPolyhedra.cc.
References FatalException, G4VDivisionParameterisation::fDeleteSolid, G4VDivisionParameterisation::fmotherSolid, G4VDivisionParameterisation::fReflectedSolid, G4endl, G4Exception(), G4Polyhedra::GetEndPhi(), G4VSolid::GetEntityType(), G4VSolid::GetName(), G4Polyhedra::GetOriginalParameters(), G4Polyhedra::GetStartPhi(), G4Polyhedra::IsGeneric(), G4PolyhedraHistorical::Num_z_planes, G4PolyhedraHistorical::numSide, G4PolyhedraHistorical::Rmax, G4PolyhedraHistorical::Rmin, and G4PolyhedraHistorical::Z_values.
00052 : G4VDivisionParameterisation( axis, nDiv, width, offset, divType, msolid ) 00053 { 00054 G4Polyhedra* msol = (G4Polyhedra*)(msolid); 00055 if ((msolid->GetEntityType() != "G4ReflectedSolid") && (msol->IsGeneric())) 00056 { 00057 std::ostringstream message; 00058 message << "Generic construct for G4Polyhedra NOT supported." << G4endl 00059 << "Sorry! Solid: " << msol->GetName(); 00060 G4Exception("G4VParameterisationPolyhedra::G4VParameterisationPolyhedra()", 00061 "GeomDiv0001", FatalException, message); 00062 } 00063 if (msolid->GetEntityType() == "G4ReflectedSolid") 00064 { 00065 // Get constituent solid 00066 G4VSolid* mConstituentSolid 00067 = ((G4ReflectedSolid*)msolid)->GetConstituentMovedSolid(); 00068 msol = (G4Polyhedra*)(mConstituentSolid); 00069 00070 // Get parameters 00071 G4int nofSides = msol->GetOriginalParameters()->numSide; 00072 G4int nofZplanes = msol->GetOriginalParameters()->Num_z_planes; 00073 G4double* zValues = msol->GetOriginalParameters()->Z_values; 00074 G4double* rminValues = msol->GetOriginalParameters()->Rmin; 00075 G4double* rmaxValues = msol->GetOriginalParameters()->Rmax; 00076 00077 // Invert z values, 00078 // convert radius parameters 00079 G4double* rminValues2 = new G4double[nofZplanes]; 00080 G4double* rmaxValues2 = new G4double[nofZplanes]; 00081 G4double* zValuesRefl = new G4double[nofZplanes]; 00082 for (G4int i=0; i<nofZplanes; i++) 00083 { 00084 rminValues2[i] = rminValues[i] * ConvertRadiusFactor(*msol); 00085 rmaxValues2[i] = rmaxValues[i] * ConvertRadiusFactor(*msol); 00086 zValuesRefl[i] = - zValues[i]; 00087 } 00088 00089 G4Polyhedra* newSolid 00090 = new G4Polyhedra(msol->GetName(), 00091 msol->GetStartPhi(), 00092 msol->GetEndPhi() - msol->GetStartPhi(), 00093 nofSides, 00094 nofZplanes, zValuesRefl, rminValues2, rmaxValues2); 00095 00096 delete [] rminValues2; 00097 delete [] rmaxValues2; 00098 delete [] zValuesRefl; 00099 00100 msol = newSolid; 00101 fmotherSolid = newSolid; 00102 fReflectedSolid = true; 00103 fDeleteSolid = true; 00104 } 00105 }
G4VParameterisationPolyhedra::~G4VParameterisationPolyhedra | ( | ) | [virtual] |