54 numZPlanes, zPlane, rInner, rOuter))
112 if (
this == &source)
return *
this;
160 delete original_parameters;
191 typedef G4int int4[4];
199 std::vector<G4int*> triQuads;
202 while (remaining >= 3)
206 G4int A = -1, B = -1, C = -1;
207 G4int iStepper = iStarter;
210 if (A < 0) { A = iStepper; }
211 else if (B < 0) { B = iStepper; }
212 else if (C < 0) { C = iStepper; }
217 while (chopped[iStepper]);
219 while (C < 0 && iStepper != iStarter);
234 triQuads.push_back(tq);
244 while (chopped[iStarter]);
252 faces_vec =
new int4[nFaces];
256 for (
G4int iEnd = 0; iEnd < 2; ++iEnd)
258 for (
size_t i = 0; i < triQuads.size(); ++i)
271 a = triQuads[i][0] + addition;
272 b = triQuads[i][2] + addition;
273 c = triQuads[i][1] + addition;
276 G4int bc = std::abs(c - b);
277 G4int ca = std::abs(a - c);
278 faces_vec[iface][0] = (ab == 1 || ab == d)? a: -a;
279 faces_vec[iface][1] = (bc == 1 || bc == d)? b: -b;
280 faces_vec[iface][2] = (ca == 1 || ca == d)? c: -c;
281 faces_vec[iface][3] = 0;
288 xyz =
new double3[nNodes];
292 for (
G4int iSide = 0; iSide < numSide; ++iSide)
296 xyz[ixyz][0] =
GetCorner(iCorner).
r * std::cos(phi);
297 xyz[ixyz][1] =
GetCorner(iCorner).
r * std::sin(phi);
301 faces_vec[iface][0] = ixyz + 1;
304 faces_vec[iface][3] = ixyz + 2;
308 faces_vec[iface][0] = ixyz + 1;
310 faces_vec[iface][2] = ixyz + 2;
323 xyz[ixyz][0] =
GetCorner(iCorner).
r * std::cos(phi);
324 xyz[ixyz][1] =
GetCorner(iCorner).
r * std::sin(phi);
333 xyz =
new double3[nNodes];
334 faces_vec =
new int4[nFaces];
338 G4int ixyz = 0, iface = 0;
343 xyz[ixyz][0] =
GetCorner(iCorner).
r * std::cos(phi);
344 xyz[ixyz][1] =
GetCorner(iCorner).
r * std::sin(phi);
350 faces_vec[iface][0] = ixyz + 1;
353 faces_vec[iface][3] = ixyz + 2;
357 faces_vec[iface][0] = ixyz + 1;
359 faces_vec[iface][2] = ixyz + 2;
367 faces_vec[iface][0] = ixyz + 1;
370 faces_vec[iface][3] = ixyz + 2;
374 faces_vec[iface][0] = ixyz + 1;
376 faces_vec[iface][2] = ixyz - nFaces + 2;
387 G4int problem = polyhedron->createPolyhedron(nNodes, nFaces, xyz, faces_vec);
392 std::ostringstream message;
393 message <<
"Problem creating G4Polyhedron for: " <<
GetName();
394 G4Exception(
"G4Polyhedra::CreatePolyhedron()",
"GeomSolids1002",
G4UPolyhedra & operator=(const G4UPolyhedra &source)
G4int GetNumRZCorner() const
G4UPolyhedra(const G4String &name, G4double phiStart, G4double phiTotal, G4int numSide, G4int numZPlanes, const G4double zPlane[], const G4double rInner[], const G4double rOuter[])
void ComputeDimensions(G4VPVParameterisation *p, const G4int n, const G4VPhysicalVolume *pRep)
G4double GetEndPhi() const
G4double GetStartPhi() const
G4PolyhedraHistorical * GetOriginalParameters() const
static const G4double A[nN]
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *comments)
G4PolyhedraSideRZ GetCorner(const G4int index) const
virtual void ComputeDimensions(G4Box &, const G4int, const G4VPhysicalVolume *) const
G4Polyhedron * CreatePolyhedron() const
G4USolid & operator=(const G4USolid &rhs)