58 Deferred = (npar == 0);
60 if (Deferred)
return solid;
62 for (
G4int i=0;i<3;i++){
66 if ( shape ==
"BOX" ) {
71 OKAxis[0]=OKAxis[1]=OKAxis[2]=
true;
73 NegVolPars = pX<0 || pY<0 || pZ<0;
75 if (!(NegVolPars || Deferred)) {
76 solid =
new G4Box(vname, pX, pY, pZ);
79 }
else if ( shape ==
"TRD1" ) {
86 OKAxis[1]=OKAxis[2]=
true;
88 NegVolPars = pdx1<0 || pdx2<0 || pdy1<0 || pdz<0;
90 if (!(NegVolPars || Deferred)) {
91 solid =
new G4Trd(vname, pdx1, pdx2, pdy1, pdy2, pdz);
94 }
else if ( shape ==
"TRD2" ) {
103 NegVolPars = pdx1<0 || pdx2<0 || pdy1<0 || pdy2<0 || pdz<0;
105 if (!(NegVolPars || Deferred)) {
106 solid =
new G4Trd(vname, pdx1, pdx2, pdy1, pdy2, pdz);
109 }
else if ( shape ==
"TRAP" ) {
124 NegVolPars= pDz<0 || pDy1<0 || pDx1<0 || pDx2<0 || pDy2<0 || pDx3<0 || pDx4<0;
126 if (!(NegVolPars || Deferred)) {
128 if (!(pDz>0)) pDz += 0.001*
cm;
129 if (!(pDy1>0)) pDy1 += 0.001*
cm;
130 if (!(pDx1>0)) pDx1 += 0.001*
cm;
131 if (!(pDx2>0)) pDx2 += 0.001*
cm;
132 if (!(pDy2>0)) pDy2 += 0.001*
cm;
133 if (!(pDx3>0)) pDx3 += 0.001*
cm;
134 if (!(pDx4>0)) pDx4 += 0.001*
cm;
137 G4Trap(vname, pDz, pTheta, pPhi, pDy1, pDx1, pDx2, pAlp1, pDy2, pDx3,
141 }
else if ( shape ==
"TUBE" ) {
148 OKAxis[0]=OKAxis[1]=OKAxis[2]=
true;
150 NegVolPars = pRMin<0 || pRMax<0 || pDz<0;
152 if (!(NegVolPars || Deferred)) {
153 solid =
new G4Tubs(vname, pRMin, pRMax, pDz, pSPhi, pDPhi);
156 }
else if ( shape ==
"TUBS" ) {
161 G4double pDPhi = rpar[4]*deg - pSPhi;
162 if ( rpar[4]*deg <= pSPhi ) pDPhi = pDPhi + 360.*
deg;
164 OKAxis[0]=OKAxis[1]=OKAxis[2]=
true;
166 NegVolPars = pRMin<0 || pRMax<0 || pDz<0;
168 if (!(NegVolPars || Deferred)){
169 solid =
new G4Tubs(vname, pRMin, pRMax, pDz, pSPhi, pDPhi);
172 }
else if ( shape ==
"CONE" ) {
181 OKAxis[0]=OKAxis[1]=OKAxis[2]=
true;
183 NegVolPars = pDz<0 || pRmin1<0 || pRmax1<0 || pRmin2<0 || pRmax2<0;
185 if (!(NegVolPars || Deferred)){
187 G4Cons(vname, pRmin1, pRmax1, pRmin2, pRmax2, pDz, pSPhi, pDPhi);
190 }
else if ( shape ==
"CONS" ) {
197 G4double pDPhi = rpar[6]*deg - pSPhi;
198 if ( rpar[6]*deg <= pSPhi ) pDPhi = pDPhi + 360.*
deg;
200 OKAxis[0]=OKAxis[1]=OKAxis[2]=
true;
202 NegVolPars = pDz<0 || pRmin1<0 || pRmax1<0 || pRmin2<0 || pRmax2<0;
204 if (!(NegVolPars || Deferred)){
206 G4Cons(vname, pRmin1, pRmax1, pRmin2, pRmax2, pDz, pSPhi, pDPhi);
209 }
else if ( shape ==
"SPHE" ) {
219 NegVolPars = pRmin<0 || pRmax<0;
221 if (!(NegVolPars || Deferred)) {
222 solid =
new G4Sphere(vname, pRmin, pRmax, pPhi1, pDPhi, pThe1, pDThe);
225 }
else if ( shape ==
"PARA" ) {
233 OKAxis[0]=OKAxis[1]=OKAxis[2]=
true;
235 NegVolPars = pDx<0 || pDy<0 || pDz<0;
237 if (!(NegVolPars || Deferred)){
238 solid =
new G4Para(vname, pDx, pDy, pDz, pAlph, pThet, pPhi);
241 }
else if ( shape ==
"PGON" ) {
251 OKAxis[0]=OKAxis[1]=OKAxis[2]=
true;
255 for(i=0; i<nz; i++) {
259 DzArray[i] = rpar[i4]*
cm;
260 Rmin[i] = rpar[i5]*
cm;
261 Rmax[i] = rpar[i6]*
cm;
263 solid =
new G4Polyhedra(vname, pPhi1, dPhi, npdv, nz, DzArray, Rmin, Rmax);
268 }
else if ( shape ==
"PCON" ) {
277 OKAxis[0]=OKAxis[1]=OKAxis[2]=
true;
285 DzArray[i] = rpar[i4]*
cm;
286 Rmin[i] = rpar[i5]*
cm;
287 Rmax[i] = rpar[i6]*
cm;
289 solid =
new G4Polycone(vname, pPhi1, dPhi, nz, DzArray, Rmin, Rmax);
294 }
else if ( shape ==
"ELTU" ) {
299 OKAxis[0]=OKAxis[1]=OKAxis[2]=
true;
301 NegVolPars = dX<0 || dY<0 || dZ<0;
303 if (!(NegVolPars || Deferred)) {
307 }
else if ( shape ==
"HYPE" ) {
313 NegVolPars = pRmin<0 || pRmax<0 || pDz<0;
315 if (!(NegVolPars || Deferred)){
316 solid =
new G4Hype(vname, pRmin, pRmax, pThet, pThet, pDz);
318 G4cerr <<
"Negative length parameters not supported for shape "
322 }
else if ( shape ==
"GTRA" ) {
326 }
else if ( shape ==
"CTUB" ) {
G4VSolid * G3toG4MakeSolid(const G4String &vname, const G4String &shape, const G4double *rpar, const G4int npar, G4bool &NegVolPars, G4bool &Deferred, G4bool *OKAxis)
G4GLOB_DLL std::ostream G4cerr