65 const G4Box*
const box)
67 xercesc::DOMElement* box_dimensionsElement =
NewElement(
"box_dimensions");
68 box_dimensionsElement->
70 box_dimensionsElement->
72 box_dimensionsElement->
74 box_dimensionsElement->
76 parametersElement->appendChild(box_dimensionsElement);
81 const G4Trd*
const trd)
83 xercesc::DOMElement* trd_dimensionsElement =
NewElement(
"trd_dimensions");
84 trd_dimensionsElement->
86 trd_dimensionsElement->
88 trd_dimensionsElement->
90 trd_dimensionsElement->
92 trd_dimensionsElement->
94 trd_dimensionsElement->
96 parametersElement->appendChild(trd_dimensionsElement);
104 const G4double phi = (simaxis.
z() != 1.0)
105 ? (std::atan(simaxis.
y()/simaxis.
x())) : (0.0);
106 const G4double theta = std::acos(simaxis.
z());
110 xercesc::DOMElement* trap_dimensionsElement =
NewElement(
"trap");
111 trap_dimensionsElement->
113 trap_dimensionsElement->
115 trap_dimensionsElement->
117 trap_dimensionsElement->
119 trap_dimensionsElement->
121 trap_dimensionsElement->
123 trap_dimensionsElement->
125 trap_dimensionsElement->
127 trap_dimensionsElement->
129 trap_dimensionsElement->
131 trap_dimensionsElement->
133 trap_dimensionsElement->
135 trap_dimensionsElement->
137 parametersElement->appendChild(trap_dimensionsElement);
144 xercesc::DOMElement* tube_dimensionsElement =
NewElement(
"tube_dimensions");
145 tube_dimensionsElement->
147 tube_dimensionsElement->
149 tube_dimensionsElement->
151 tube_dimensionsElement->
153 tube_dimensionsElement->
155 tube_dimensionsElement->
157 tube_dimensionsElement->
159 parametersElement->appendChild(tube_dimensionsElement);
167 xercesc::DOMElement* cone_dimensionsElement =
NewElement(
"cone_dimensions");
168 cone_dimensionsElement->
170 cone_dimensionsElement->
172 cone_dimensionsElement->
174 cone_dimensionsElement->
176 cone_dimensionsElement->
178 cone_dimensionsElement->
180 cone_dimensionsElement->
182 cone_dimensionsElement->
184 cone_dimensionsElement->
186 parametersElement->appendChild(cone_dimensionsElement);
193 xercesc::DOMElement* sphere_dimensionsElement =
195 sphere_dimensionsElement->setAttributeNode(
NewAttribute(
"rmin",
197 sphere_dimensionsElement->setAttributeNode(
NewAttribute(
"rmax",
199 sphere_dimensionsElement->setAttributeNode(
NewAttribute(
"startphi",
201 sphere_dimensionsElement->setAttributeNode(
NewAttribute(
"deltaphi",
203 sphere_dimensionsElement->setAttributeNode(
NewAttribute(
"starttheta",
205 sphere_dimensionsElement->setAttributeNode(
NewAttribute(
"deltatheta",
207 sphere_dimensionsElement->setAttributeNode(
NewAttribute(
"aunit",
"deg"));
208 sphere_dimensionsElement->setAttributeNode(
NewAttribute(
"lunit",
"mm"));
209 parametersElement->appendChild(sphere_dimensionsElement);
214 const G4Orb*
const orb)
216 xercesc::DOMElement* orb_dimensionsElement =
NewElement(
"orb_dimensions");
217 orb_dimensionsElement->setAttributeNode(
NewAttribute(
"r",
219 orb_dimensionsElement->setAttributeNode(
NewAttribute(
"lunit",
"mm"));
220 parametersElement->appendChild(orb_dimensionsElement);
227 xercesc::DOMElement* torus_dimensionsElement =
229 torus_dimensionsElement->
231 torus_dimensionsElement->
233 torus_dimensionsElement->
235 torus_dimensionsElement->
237 torus_dimensionsElement->
239 torus_dimensionsElement->
241 torus_dimensionsElement->
243 parametersElement->appendChild(torus_dimensionsElement);
252 const G4double theta = std::acos(simaxis.
z());
253 const G4double phi = (simaxis.
z() != 1.0)
254 ? (std::atan(simaxis.
y()/simaxis.
x())) : (0.0);
256 xercesc::DOMElement* para_dimensionsElement =
NewElement(
"para_dimensions");
257 para_dimensionsElement->
259 para_dimensionsElement->
261 para_dimensionsElement->
263 para_dimensionsElement->
265 para_dimensionsElement->
267 para_dimensionsElement->
269 para_dimensionsElement->
271 para_dimensionsElement->
273 parametersElement->appendChild(para_dimensionsElement);
280 xercesc::DOMElement* hype_dimensionsElement =
NewElement(
"hype_dimensions");
281 hype_dimensionsElement->
283 hype_dimensionsElement->
285 hype_dimensionsElement->
287 hype_dimensionsElement->
289 hype_dimensionsElement->
291 hype_dimensionsElement->
293 hype_dimensionsElement->
295 parametersElement->appendChild(hype_dimensionsElement);
306 std::stringstream os;
311 xercesc::DOMElement* parametersElement =
NewElement(
"parameters");
312 parametersElement->setAttributeNode(
NewAttribute(
"number",index+1));
322 paramvolElement->appendChild(parametersElement);
326 if (
G4Box* box = dynamic_cast<G4Box*>(solid))
329 const_cast<G4VPhysicalVolume*>(paramvol));
332 if (
G4Trd* trd = dynamic_cast<G4Trd*>(solid))
335 const_cast<G4VPhysicalVolume*>(paramvol));
338 if (
G4Trap* trap = dynamic_cast<G4Trap*>(solid))
341 const_cast<G4VPhysicalVolume*>(paramvol));
344 if (
G4Tubs* tube = dynamic_cast<G4Tubs*>(solid))
347 const_cast<G4VPhysicalVolume*>(paramvol));
350 if (
G4Cons* cone = dynamic_cast<G4Cons*>(solid))
353 const_cast<G4VPhysicalVolume*>(paramvol));
356 if (
G4Sphere* sphere = dynamic_cast<G4Sphere*>(solid))
359 const_cast<G4VPhysicalVolume*>(paramvol));
362 if (
G4Orb* orb = dynamic_cast<G4Orb*>(solid))
365 const_cast<G4VPhysicalVolume*>(paramvol));
368 if (
G4Torus* torus = dynamic_cast<G4Torus*>(solid))
371 const_cast<G4VPhysicalVolume*>(paramvol));
374 if (
G4Para* para = dynamic_cast<G4Para*>(solid))
377 const_cast<G4VPhysicalVolume*>(paramvol));
380 if (
G4Hype* hype = dynamic_cast<G4Hype*>(solid))
383 const_cast<G4VPhysicalVolume*>(paramvol));
389 +
"' cannot be used in parameterised volume!";
390 G4Exception(
"G4GDMLWriteParamvol::ParametersWrite()",
402 xercesc::DOMElement* paramvolElement =
NewElement(
"paramvol");
403 paramvolElement->setAttributeNode(
NewAttribute(
"ncopies",
405 xercesc::DOMElement* volumerefElement =
NewElement(
"volumeref");
406 volumerefElement->setAttributeNode(
NewAttribute(
"ref",volumeref));
408 xercesc::DOMElement* algorithmElement =
410 paramvolElement->appendChild(volumerefElement);
411 paramvolElement->appendChild(algorithmElement);
413 volumeElement->appendChild(paramvolElement);
426 for (
G4int i=0; i<parameterCount; i++)