70 xercesc::DOMElement* box_dimensionsElement =
NewElement(
"box_dimensions");
71 box_dimensionsElement->
73 box_dimensionsElement->
75 box_dimensionsElement->
77 box_dimensionsElement->
79 parametersElement->appendChild(box_dimensionsElement);
84 const G4Trd*
const trd)
86 xercesc::DOMElement* trd_dimensionsElement =
NewElement(
"trd_dimensions");
87 trd_dimensionsElement->
89 trd_dimensionsElement->
91 trd_dimensionsElement->
93 trd_dimensionsElement->
95 trd_dimensionsElement->
97 trd_dimensionsElement->
99 parametersElement->appendChild(trd_dimensionsElement);
108 ? (std::atan(simaxis.
y()/simaxis.
x())) : (0.0);
113 xercesc::DOMElement* trap_dimensionsElement =
NewElement(
"trap");
114 trap_dimensionsElement->
116 trap_dimensionsElement->
118 trap_dimensionsElement->
120 trap_dimensionsElement->
122 trap_dimensionsElement->
124 trap_dimensionsElement->
126 trap_dimensionsElement->
128 trap_dimensionsElement->
130 trap_dimensionsElement->
132 trap_dimensionsElement->
134 trap_dimensionsElement->
136 trap_dimensionsElement->
138 trap_dimensionsElement->
140 parametersElement->appendChild(trap_dimensionsElement);
147 xercesc::DOMElement* tube_dimensionsElement =
NewElement(
"tube_dimensions");
148 tube_dimensionsElement->
150 tube_dimensionsElement->
152 tube_dimensionsElement->
154 tube_dimensionsElement->
156 tube_dimensionsElement->
158 tube_dimensionsElement->
160 tube_dimensionsElement->
162 parametersElement->appendChild(tube_dimensionsElement);
170 xercesc::DOMElement* cone_dimensionsElement =
NewElement(
"cone_dimensions");
171 cone_dimensionsElement->
173 cone_dimensionsElement->
175 cone_dimensionsElement->
177 cone_dimensionsElement->
179 cone_dimensionsElement->
181 cone_dimensionsElement->
183 cone_dimensionsElement->
185 cone_dimensionsElement->
187 cone_dimensionsElement->
189 parametersElement->appendChild(cone_dimensionsElement);
196 xercesc::DOMElement* sphere_dimensionsElement =
198 sphere_dimensionsElement->setAttributeNode(
NewAttribute(
"rmin",
200 sphere_dimensionsElement->setAttributeNode(
NewAttribute(
"rmax",
202 sphere_dimensionsElement->setAttributeNode(
NewAttribute(
"startphi",
204 sphere_dimensionsElement->setAttributeNode(
NewAttribute(
"deltaphi",
206 sphere_dimensionsElement->setAttributeNode(
NewAttribute(
"starttheta",
208 sphere_dimensionsElement->setAttributeNode(
NewAttribute(
"deltatheta",
210 sphere_dimensionsElement->setAttributeNode(
NewAttribute(
"aunit",
"deg"));
211 sphere_dimensionsElement->setAttributeNode(
NewAttribute(
"lunit",
"mm"));
212 parametersElement->appendChild(sphere_dimensionsElement);
217 const G4Orb*
const orb)
219 xercesc::DOMElement* orb_dimensionsElement =
NewElement(
"orb_dimensions");
220 orb_dimensionsElement->setAttributeNode(
NewAttribute(
"r",
222 orb_dimensionsElement->setAttributeNode(
NewAttribute(
"lunit",
"mm"));
223 parametersElement->appendChild(orb_dimensionsElement);
230 xercesc::DOMElement* torus_dimensionsElement =
232 torus_dimensionsElement->
234 torus_dimensionsElement->
236 torus_dimensionsElement->
238 torus_dimensionsElement->
240 torus_dimensionsElement->
242 torus_dimensionsElement->
244 torus_dimensionsElement->
246 parametersElement->appendChild(torus_dimensionsElement);
253 xercesc::DOMElement* ellipsoid_dimensionsElement =
255 ellipsoid_dimensionsElement->
257 ellipsoid_dimensionsElement->
259 ellipsoid_dimensionsElement->
261 ellipsoid_dimensionsElement->
263 ellipsoid_dimensionsElement->
265 ellipsoid_dimensionsElement->
267 parametersElement->appendChild(ellipsoid_dimensionsElement);
279 ? (std::atan(simaxis.
y()/simaxis.
x())) : (0.0);
281 xercesc::DOMElement* para_dimensionsElement =
NewElement(
"para_dimensions");
282 para_dimensionsElement->
284 para_dimensionsElement->
286 para_dimensionsElement->
288 para_dimensionsElement->
290 para_dimensionsElement->
292 para_dimensionsElement->
294 para_dimensionsElement->
296 para_dimensionsElement->
298 parametersElement->appendChild(para_dimensionsElement);
305 xercesc::DOMElement* hype_dimensionsElement =
NewElement(
"hype_dimensions");
306 hype_dimensionsElement->
308 hype_dimensionsElement->
310 hype_dimensionsElement->
312 hype_dimensionsElement->
314 hype_dimensionsElement->
316 hype_dimensionsElement->
318 hype_dimensionsElement->
320 parametersElement->appendChild(hype_dimensionsElement);
327 xercesc::DOMElement* pcone_dimensionsElement
330 pcone_dimensionsElement->setAttributeNode(
NewAttribute(
"numRZ",
332 pcone_dimensionsElement->setAttributeNode(
NewAttribute(
"startPhi",
334 pcone_dimensionsElement->setAttributeNode(
NewAttribute(
"openPhi",
336 pcone_dimensionsElement->setAttributeNode(
NewAttribute(
"aunit",
"deg"));
337 pcone_dimensionsElement->setAttributeNode(
NewAttribute(
"lunit",
"mm"));
339 parametersElement->appendChild(pcone_dimensionsElement);
345 for (
size_t i=0; i<num_zplanes; i++)
348 rmin_array[i],rmax_array[i]);
356 xercesc::DOMElement* polyhedra_dimensionsElement
359 polyhedra_dimensionsElement->setAttributeNode(
NewAttribute(
"numRZ",
361 polyhedra_dimensionsElement->setAttributeNode(
NewAttribute(
"numSide",
363 polyhedra_dimensionsElement->setAttributeNode(
NewAttribute(
"startPhi",
365 polyhedra_dimensionsElement->setAttributeNode(
NewAttribute(
"openPhi",
367 polyhedra_dimensionsElement->setAttributeNode(
NewAttribute(
"aunit",
"deg"));
368 polyhedra_dimensionsElement->setAttributeNode(
NewAttribute(
"lunit",
"mm"));
370 parametersElement->appendChild(polyhedra_dimensionsElement);
376 for (
size_t i=0; i<num_zplanes; i++)
378 ZplaneWrite(polyhedra_dimensionsElement,z_array[i],
379 rmin_array[i],rmax_array[i]);
391 std::stringstream os;
396 xercesc::DOMElement* parametersElement =
NewElement(
"parameters");
397 parametersElement->setAttributeNode(
NewAttribute(
"number",index+1));
407 paramvolElement->appendChild(parametersElement);
411 if (
G4Box*
box = dynamic_cast<G4Box*>(solid))
414 const_cast<G4VPhysicalVolume*>(paramvol));
417 if (
G4Trd* trd = dynamic_cast<G4Trd*>(solid))
420 const_cast<G4VPhysicalVolume*>(paramvol));
423 if (
G4Trap* trap = dynamic_cast<G4Trap*>(solid))
426 const_cast<G4VPhysicalVolume*>(paramvol));
429 if (
G4Tubs* tube = dynamic_cast<G4Tubs*>(solid))
432 const_cast<G4VPhysicalVolume*>(paramvol));
435 if (
G4Cons* cone = dynamic_cast<G4Cons*>(solid))
438 const_cast<G4VPhysicalVolume*>(paramvol));
441 if (
G4Sphere* sphere = dynamic_cast<G4Sphere*>(solid))
444 const_cast<G4VPhysicalVolume*>(paramvol));
447 if (
G4Orb* orb = dynamic_cast<G4Orb*>(solid))
450 const_cast<G4VPhysicalVolume*>(paramvol));
453 if (
G4Torus* torus = dynamic_cast<G4Torus*>(solid))
456 const_cast<G4VPhysicalVolume*>(paramvol));
459 if (
G4Ellipsoid* ellipsoid = dynamic_cast<G4Ellipsoid*>(solid))
462 const_cast<G4VPhysicalVolume*>(paramvol));
465 if (
G4Para* para = dynamic_cast<G4Para*>(solid))
468 const_cast<G4VPhysicalVolume*>(paramvol));
471 if (
G4Hype* hype = dynamic_cast<G4Hype*>(solid))
474 const_cast<G4VPhysicalVolume*>(paramvol));
477 if (
G4Polycone* pcone = dynamic_cast<G4Polycone*>(solid))
480 const_cast<G4VPhysicalVolume*>(paramvol));
483 if (
G4Polyhedra* polyhedra = dynamic_cast<G4Polyhedra*>(solid))
486 const_cast<G4VPhysicalVolume*>(paramvol));
492 +
"' cannot be used in parameterised volume!";
493 G4Exception(
"G4GDMLWriteParamvol::ParametersWrite()",
505 xercesc::DOMElement* paramvolElement =
NewElement(
"paramvol");
506 paramvolElement->setAttributeNode(
NewAttribute(
"ncopies",
508 xercesc::DOMElement* volumerefElement =
NewElement(
"volumeref");
509 volumerefElement->setAttributeNode(
NewAttribute(
"ref",volumeref));
511 xercesc::DOMElement* algorithmElement =
513 paramvolElement->appendChild(volumerefElement);
514 paramvolElement->appendChild(algorithmElement);
516 volumeElement->appendChild(paramvolElement);
529 for (
G4int i=0; i<parameterCount; i++)