92 if (
this == &source)
return *
this;
125 const G4int numSide =
126 G4int(G4Polyhedron::GetNumberOfRotationSteps()
132 typedef G4int int4[4];
140 std::vector<G4int*> triQuads;
143 while (remaining >= 3)
147 G4int A = -1, B = -1, C = -1;
148 G4int iStepper = iStarter;
151 if (A < 0) { A = iStepper; }
152 else if (B < 0) { B = iStepper; }
153 else if (C < 0) { C = iStepper; }
158 while (chopped[iStepper]);
160 while (C < 0 && iStepper != iStarter);
175 triQuads.push_back(tq);
185 while (chopped[iStarter]);
192 faces_vec =
new int4[nFaces];
196 for (
G4int iEnd = 0; iEnd < 2; ++iEnd)
198 for (
size_t i = 0; i < triQuads.size(); ++i)
211 a = triQuads[i][0] + addition;
212 b = triQuads[i][2] + addition;
213 c = triQuads[i][1] + addition;
216 G4int bc = std::abs(c - b);
217 G4int ca = std::abs(a - c);
218 faces_vec[iface][0] = (ab == 1 || ab == d)? a: -a;
219 faces_vec[iface][1] = (bc == 1 || bc == d)? b: -b;
220 faces_vec[iface][2] = (ca == 1 || ca == d)? c: -c;
221 faces_vec[iface][3] = 0;
228 xyz =
new double3[nNodes];
232 for (
G4int iSide = 0; iSide < numSide; ++iSide)
236 xyz[ixyz][0] =
GetCorner(iCorner).
r * std::cos(phi);
237 xyz[ixyz][1] =
GetCorner(iCorner).
r * std::sin(phi);
243 faces_vec[iface][0] = ixyz + 1;
246 faces_vec[iface][3] = ixyz + 2;
250 faces_vec[iface][0] = ixyz + 1;
252 faces_vec[iface][2] = ixyz + 2;
256 else if (iSide == numSide - 1)
260 faces_vec[iface][0] = ixyz + 1;
263 faces_vec[iface][3] = -(ixyz + 2);
267 faces_vec[iface][0] = ixyz + 1;
269 faces_vec[iface][2] = ixyz + 2;
277 faces_vec[iface][0] = ixyz + 1;
280 faces_vec[iface][3] = -(ixyz + 2);
284 faces_vec[iface][0] = ixyz + 1;
286 faces_vec[iface][2] = ixyz + 2;
300 xyz[ixyz][0] =
GetCorner(iCorner).
r * std::cos(phi);
301 xyz[ixyz][1] =
GetCorner(iCorner).
r * std::sin(phi);
310 xyz =
new double3[nNodes];
311 faces_vec =
new int4[nFaces];
314 G4int ixyz = 0, iface = 0;
315 for (
G4int iSide = 0; iSide < numSide; ++iSide)
319 xyz[ixyz][0] =
GetCorner(iCorner).
r * std::cos(phi);
320 xyz[ixyz][1] =
GetCorner(iCorner).
r * std::sin(phi);
323 if (iSide < numSide - 1)
327 faces_vec[iface][0] = ixyz + 1;
330 faces_vec[iface][3] = -(ixyz + 2);
334 faces_vec[iface][0] = ixyz + 1;
336 faces_vec[iface][2] = ixyz + 2;
344 faces_vec[iface][0] = ixyz + 1;
347 faces_vec[iface][3] = -(ixyz + 2);
351 faces_vec[iface][0] = ixyz + 1;
353 faces_vec[iface][2] = ixyz - nFaces + 2;
364 G4int problem = polyhedron->createPolyhedron(nNodes, nFaces, xyz, faces_vec);
369 std::ostringstream message;
370 message <<
"Problem creating G4Polyhedron for: " <<
GetName();
371 G4Exception(
"G4GenericPolycone::CreatePolyhedron()",
"GeomSolids1002",
G4double GetStartPhi() const
G4Polyhedron * CreatePolyhedron() const
G4PolyconeSideRZ GetCorner(G4int index) const
G4double GetEndPhi() const
G4int GetNumRZCorner() const
G4UGenericPolycone(const G4String &name, G4double phiStart, G4double phiTotal, G4int numRZ, const G4double r[], const G4double z[])
static const G4double A[nN]
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *comments)
G4UGenericPolycone & operator=(const G4UGenericPolycone &source)
G4USolid & operator=(const G4USolid &rhs)