91 if (
this == &source)
return *
this;
124 const G4int numSide =
131 typedef G4int int4[4];
139 std::vector<G4int*> triQuads;
142 while (remaining >= 3)
146 G4int A = -1, B = -1, C = -1;
147 G4int iStepper = iStarter;
150 if (A < 0) { A = iStepper; }
151 else if (B < 0) { B = iStepper; }
152 else if (C < 0) { C = iStepper; }
157 while (chopped[iStepper]);
159 while (C < 0 && iStepper != iStarter);
174 triQuads.push_back(tq);
184 while (chopped[iStarter]);
191 faces_vec =
new int4[nFaces];
195 for (
G4int iEnd = 0; iEnd < 2; ++iEnd)
197 for (
size_t i = 0; i < triQuads.size(); ++i)
210 a = triQuads[i][0] + addition;
211 b = triQuads[i][2] + addition;
212 c = triQuads[i][1] + addition;
214 G4int ab = std::abs(b - a);
215 G4int bc = std::abs(c - b);
216 G4int ca = std::abs(a - c);
217 faces_vec[iface][0] = (ab == 1 || ab ==
d)? a: -a;
218 faces_vec[iface][1] = (bc == 1 || bc ==
d)? b: -b;
219 faces_vec[iface][2] = (ca == 1 || ca ==
d)? c: -c;
220 faces_vec[iface][3] = 0;
227 xyz =
new double3[nNodes];
231 for (
G4int iSide = 0; iSide < numSide; ++iSide)
235 xyz[ixyz][0] =
GetCorner(iCorner).
r * std::cos(phi);
236 xyz[ixyz][1] =
GetCorner(iCorner).
r * std::sin(phi);
242 faces_vec[iface][0] = ixyz + 1;
245 faces_vec[iface][3] = ixyz + 2;
249 faces_vec[iface][0] = ixyz + 1;
251 faces_vec[iface][2] = ixyz + 2;
255 else if (iSide == numSide - 1)
259 faces_vec[iface][0] = ixyz + 1;
262 faces_vec[iface][3] = -(ixyz + 2);
266 faces_vec[iface][0] = ixyz + 1;
268 faces_vec[iface][2] = ixyz + 2;
276 faces_vec[iface][0] = ixyz + 1;
279 faces_vec[iface][3] = -(ixyz + 2);
283 faces_vec[iface][0] = ixyz + 1;
285 faces_vec[iface][2] = ixyz + 2;
299 xyz[ixyz][0] =
GetCorner(iCorner).
r * std::cos(phi);
300 xyz[ixyz][1] =
GetCorner(iCorner).
r * std::sin(phi);
309 xyz =
new double3[nNodes];
310 faces_vec =
new int4[nFaces];
313 G4int ixyz = 0, iface = 0;
314 for (
G4int iSide = 0; iSide < numSide; ++iSide)
318 xyz[ixyz][0] =
GetCorner(iCorner).
r * std::cos(phi);
319 xyz[ixyz][1] =
GetCorner(iCorner).
r * std::sin(phi);
322 if (iSide < numSide - 1)
326 faces_vec[iface][0] = ixyz + 1;
329 faces_vec[iface][3] = -(ixyz + 2);
333 faces_vec[iface][0] = ixyz + 1;
335 faces_vec[iface][2] = ixyz + 2;
343 faces_vec[iface][0] = ixyz + 1;
346 faces_vec[iface][3] = -(ixyz + 2);
350 faces_vec[iface][0] = ixyz + 1;
352 faces_vec[iface][2] = ixyz - nFaces + 2;
368 std::ostringstream message;
369 message <<
"Problem creating G4Polyhedron for: " <<
GetName();
370 G4Exception(
"G4GenericPolycone::CreatePolyhedron()",
"GeomSolids1002",
G4double GetStartPhi() const
G4int createPolyhedron(G4int Nnodes, G4int Nfaces, const G4double xyz[][3], const G4int faces[][4])
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[])
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *comments)
G4UGenericPolycone & operator=(const G4UGenericPolycone &source)
static G4int GetNumberOfRotationSteps()
G4USolid & operator=(const G4USolid &rhs)