54 numZPlanes, zPlane, rInner, rOuter))
112 if (
this == &source)
return *
this;
150 delete original_parameters;
181 typedef G4int int4[4];
189 std::vector<G4int*> triQuads;
192 while (remaining >= 3)
196 G4int A = -1, B = -1, C = -1;
197 G4int iStepper = iStarter;
200 if (A < 0) { A = iStepper; }
201 else if (B < 0) { B = iStepper; }
202 else if (C < 0) { C = iStepper; }
207 while (chopped[iStepper]);
209 while (C < 0 && iStepper != iStarter);
224 triQuads.push_back(tq);
234 while (chopped[iStarter]);
242 faces_vec =
new int4[nFaces];
246 for (
G4int iEnd = 0; iEnd < 2; ++iEnd)
248 for (
size_t i = 0; i < triQuads.size(); ++i)
261 a = triQuads[i][0] + addition;
262 b = triQuads[i][2] + addition;
263 c = triQuads[i][1] + addition;
265 G4int ab = std::abs(b - a);
266 G4int bc = std::abs(c - b);
267 G4int ca = std::abs(a - c);
268 faces_vec[iface][0] = (ab == 1 || ab ==
d)? a: -a;
269 faces_vec[iface][1] = (bc == 1 || bc ==
d)? b: -b;
270 faces_vec[iface][2] = (ca == 1 || ca ==
d)? c: -c;
271 faces_vec[iface][3] = 0;
278 xyz =
new double3[nNodes];
282 for (
G4int iSide = 0; iSide < numSide; ++iSide)
286 xyz[ixyz][0] =
GetCorner(iCorner).
r * std::cos(phi);
287 xyz[ixyz][1] =
GetCorner(iCorner).
r * std::sin(phi);
291 faces_vec[iface][0] = ixyz + 1;
294 faces_vec[iface][3] = ixyz + 2;
298 faces_vec[iface][0] = ixyz + 1;
300 faces_vec[iface][2] = ixyz + 2;
313 xyz[ixyz][0] =
GetCorner(iCorner).
r * std::cos(phi);
314 xyz[ixyz][1] =
GetCorner(iCorner).
r * std::sin(phi);
323 xyz =
new double3[nNodes];
324 faces_vec =
new int4[nFaces];
328 G4int ixyz = 0, iface = 0;
333 xyz[ixyz][0] =
GetCorner(iCorner).
r * std::cos(phi);
334 xyz[ixyz][1] =
GetCorner(iCorner).
r * std::sin(phi);
340 faces_vec[iface][0] = ixyz + 1;
343 faces_vec[iface][3] = ixyz + 2;
347 faces_vec[iface][0] = ixyz + 1;
349 faces_vec[iface][2] = ixyz + 2;
357 faces_vec[iface][0] = ixyz + 1;
360 faces_vec[iface][3] = ixyz + 2;
364 faces_vec[iface][0] = ixyz + 1;
366 faces_vec[iface][2] = ixyz - nFaces + 2;
382 std::ostringstream message;
383 message <<
"Problem creating G4Polyhedron for: " <<
GetName();
384 G4Exception(
"G4Polyhedra::CreatePolyhedron()",
"GeomSolids1002",
G4UPolyhedra & operator=(const G4UPolyhedra &source)
G4int createPolyhedron(G4int Nnodes, G4int Nfaces, const G4double xyz[][3], const G4int faces[][4])
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
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)