69 const G4Box*
const box)
71 xercesc::DOMElement* box_dimensionsElement =
NewElement(
"box_dimensions");
72 box_dimensionsElement->
74 box_dimensionsElement->
76 box_dimensionsElement->
78 box_dimensionsElement->
80 parametersElement->appendChild(box_dimensionsElement);
85 const G4Trd*
const trd)
87 xercesc::DOMElement* trd_dimensionsElement =
NewElement(
"trd_dimensions");
88 trd_dimensionsElement->
90 trd_dimensionsElement->
92 trd_dimensionsElement->
94 trd_dimensionsElement->
96 trd_dimensionsElement->
98 trd_dimensionsElement->
100 parametersElement->appendChild(trd_dimensionsElement);
108 const G4double phi = (simaxis.
z() != 1.0)
109 ? (std::atan(simaxis.
y()/simaxis.
x())) : (0.0);
110 const G4double theta = std::acos(simaxis.
z());
114 xercesc::DOMElement* trap_dimensionsElement =
NewElement(
"trap");
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 trap_dimensionsElement->
139 trap_dimensionsElement->
141 parametersElement->appendChild(trap_dimensionsElement);
148 xercesc::DOMElement* tube_dimensionsElement =
NewElement(
"tube_dimensions");
149 tube_dimensionsElement->
151 tube_dimensionsElement->
153 tube_dimensionsElement->
155 tube_dimensionsElement->
157 tube_dimensionsElement->
159 tube_dimensionsElement->
161 tube_dimensionsElement->
163 parametersElement->appendChild(tube_dimensionsElement);
171 xercesc::DOMElement* cone_dimensionsElement =
NewElement(
"cone_dimensions");
172 cone_dimensionsElement->
174 cone_dimensionsElement->
176 cone_dimensionsElement->
178 cone_dimensionsElement->
180 cone_dimensionsElement->
182 cone_dimensionsElement->
184 cone_dimensionsElement->
186 cone_dimensionsElement->
188 cone_dimensionsElement->
190 parametersElement->appendChild(cone_dimensionsElement);
197 xercesc::DOMElement* sphere_dimensionsElement =
199 sphere_dimensionsElement->setAttributeNode(
NewAttribute(
"rmin",
201 sphere_dimensionsElement->setAttributeNode(
NewAttribute(
"rmax",
203 sphere_dimensionsElement->setAttributeNode(
NewAttribute(
"startphi",
205 sphere_dimensionsElement->setAttributeNode(
NewAttribute(
"deltaphi",
207 sphere_dimensionsElement->setAttributeNode(
NewAttribute(
"starttheta",
209 sphere_dimensionsElement->setAttributeNode(
NewAttribute(
"deltatheta",
211 sphere_dimensionsElement->setAttributeNode(
NewAttribute(
"aunit",
"deg"));
212 sphere_dimensionsElement->setAttributeNode(
NewAttribute(
"lunit",
"mm"));
213 parametersElement->appendChild(sphere_dimensionsElement);
218 const G4Orb*
const orb)
220 xercesc::DOMElement* orb_dimensionsElement =
NewElement(
"orb_dimensions");
221 orb_dimensionsElement->setAttributeNode(
NewAttribute(
"r",
223 orb_dimensionsElement->setAttributeNode(
NewAttribute(
"lunit",
"mm"));
224 parametersElement->appendChild(orb_dimensionsElement);
231 xercesc::DOMElement* torus_dimensionsElement =
233 torus_dimensionsElement->
235 torus_dimensionsElement->
237 torus_dimensionsElement->
239 torus_dimensionsElement->
241 torus_dimensionsElement->
243 torus_dimensionsElement->
245 torus_dimensionsElement->
247 parametersElement->appendChild(torus_dimensionsElement);
254 xercesc::DOMElement* ellipsoid_dimensionsElement =
256 ellipsoid_dimensionsElement->
258 ellipsoid_dimensionsElement->
260 ellipsoid_dimensionsElement->
262 ellipsoid_dimensionsElement->
264 ellipsoid_dimensionsElement->
266 ellipsoid_dimensionsElement->
268 parametersElement->appendChild(ellipsoid_dimensionsElement);
278 const G4double theta = std::acos(simaxis.
z());
279 const G4double phi = (simaxis.
z() != 1.0)
280 ? (std::atan(simaxis.
y()/simaxis.
x())) : (0.0);
282 xercesc::DOMElement* para_dimensionsElement =
NewElement(
"para_dimensions");
283 para_dimensionsElement->
285 para_dimensionsElement->
287 para_dimensionsElement->
289 para_dimensionsElement->
291 para_dimensionsElement->
293 para_dimensionsElement->
295 para_dimensionsElement->
297 para_dimensionsElement->
299 parametersElement->appendChild(para_dimensionsElement);
306 xercesc::DOMElement* hype_dimensionsElement =
NewElement(
"hype_dimensions");
307 hype_dimensionsElement->
309 hype_dimensionsElement->
311 hype_dimensionsElement->
313 hype_dimensionsElement->
315 hype_dimensionsElement->
317 hype_dimensionsElement->
319 hype_dimensionsElement->
321 parametersElement->appendChild(hype_dimensionsElement);
328 xercesc::DOMElement* pcone_dimensionsElement
331 pcone_dimensionsElement->setAttributeNode(
NewAttribute(
"numRZ",
333 pcone_dimensionsElement->setAttributeNode(
NewAttribute(
"startPhi",
335 pcone_dimensionsElement->setAttributeNode(
NewAttribute(
"openPhi",
337 pcone_dimensionsElement->setAttributeNode(
NewAttribute(
"aunit",
"deg"));
338 pcone_dimensionsElement->setAttributeNode(
NewAttribute(
"lunit",
"mm"));
340 parametersElement->appendChild(pcone_dimensionsElement);
346 for (
size_t i=0; i<num_zplanes; i++)
349 rmin_array[i],rmax_array[i]);
357 xercesc::DOMElement* polyhedra_dimensionsElement
360 polyhedra_dimensionsElement->setAttributeNode(
NewAttribute(
"numRZ",
362 polyhedra_dimensionsElement->setAttributeNode(
NewAttribute(
"numSide",
364 polyhedra_dimensionsElement->setAttributeNode(
NewAttribute(
"startPhi",
366 polyhedra_dimensionsElement->setAttributeNode(
NewAttribute(
"openPhi",
368 polyhedra_dimensionsElement->setAttributeNode(
NewAttribute(
"aunit",
"deg"));
369 polyhedra_dimensionsElement->setAttributeNode(
NewAttribute(
"lunit",
"mm"));
371 parametersElement->appendChild(polyhedra_dimensionsElement);
377 for (
size_t i=0; i<num_zplanes; i++)
379 ZplaneWrite(polyhedra_dimensionsElement,z_array[i],
380 rmin_array[i],rmax_array[i]);
392 std::stringstream os;
397 xercesc::DOMElement* parametersElement =
NewElement(
"parameters");
398 parametersElement->setAttributeNode(
NewAttribute(
"number",index+1));
408 paramvolElement->appendChild(parametersElement);
412 if (
G4Box* box = dynamic_cast<G4Box*>(solid))
415 const_cast<G4VPhysicalVolume*>(paramvol));
418 if (
G4Trd* trd = dynamic_cast<G4Trd*>(solid))
421 const_cast<G4VPhysicalVolume*>(paramvol));
424 if (
G4Trap* trap = dynamic_cast<G4Trap*>(solid))
427 const_cast<G4VPhysicalVolume*>(paramvol));
430 if (
G4Tubs* tube = dynamic_cast<G4Tubs*>(solid))
433 const_cast<G4VPhysicalVolume*>(paramvol));
436 if (
G4Cons* cone = dynamic_cast<G4Cons*>(solid))
439 const_cast<G4VPhysicalVolume*>(paramvol));
442 if (
G4Sphere* sphere = dynamic_cast<G4Sphere*>(solid))
445 const_cast<G4VPhysicalVolume*>(paramvol));
448 if (
G4Orb* orb = dynamic_cast<G4Orb*>(solid))
451 const_cast<G4VPhysicalVolume*>(paramvol));
454 if (
G4Torus* torus = dynamic_cast<G4Torus*>(solid))
457 const_cast<G4VPhysicalVolume*>(paramvol));
460 if (
G4Ellipsoid* ellipsoid = dynamic_cast<G4Ellipsoid*>(solid))
463 const_cast<G4VPhysicalVolume*>(paramvol));
466 if (
G4Para* para = dynamic_cast<G4Para*>(solid))
469 const_cast<G4VPhysicalVolume*>(paramvol));
472 if (
G4Hype* hype = dynamic_cast<G4Hype*>(solid))
475 const_cast<G4VPhysicalVolume*>(paramvol));
478 if (
G4Polycone* pcone = dynamic_cast<G4Polycone*>(solid))
481 const_cast<G4VPhysicalVolume*>(paramvol));
484 if (
G4Polyhedra* polyhedra = dynamic_cast<G4Polyhedra*>(solid))
487 const_cast<G4VPhysicalVolume*>(paramvol));
493 +
"' cannot be used in parameterised volume!";
494 G4Exception(
"G4GDMLWriteParamvol::ParametersWrite()",
506 xercesc::DOMElement* paramvolElement =
NewElement(
"paramvol");
507 paramvolElement->setAttributeNode(
NewAttribute(
"ncopies",
509 xercesc::DOMElement* volumerefElement =
NewElement(
"volumeref");
510 volumerefElement->setAttributeNode(
NewAttribute(
"ref",volumeref));
512 xercesc::DOMElement* algorithmElement =
514 paramvolElement->appendChild(volumerefElement);
515 paramvolElement->appendChild(algorithmElement);
517 volumeElement->appendChild(paramvolElement);
530 for (
G4int i=0; i<parameterCount; i++)
void ZplaneWrite(xercesc::DOMElement *, const G4double &, const G4double &, const G4double &)
G4double GetTanAlpha1() const
G4double GetOuterStereo() const
void ParametersWrite(xercesc::DOMElement *, const G4VPhysicalVolume *const, const G4int &)
G4double GetYHalfLength() const
G4double GetInnerRadiusMinusZ() const
G4double GetSemiAxisMax(G4int i) const
G4LogicalVolume * GetLogicalVolume() const
G4double GetRadius() const
G4double GetTanAlpha() const
G4double GetOuterRadius() const
G4String GenerateName(const G4String &, const void *const)
static constexpr double mm
virtual G4VPVParameterisation * GetParameterisation() const =0
virtual void ComputeDimensions(G4Box &, const G4int, const G4VPhysicalVolume *) const
G4double GetXHalfLength1() const
G4double GetXHalfLength4() const
xercesc::DOMElement * NewElement(const G4String &)
void Tube_dimensionsWrite(xercesc::DOMElement *, const G4Tubs *const)
G4double GetZHalfLength() const
G4double GetXHalfLength() const
G4double GetYHalfLength2() const
G4ThreeVector GetSymAxis() const
G4ThreeVector GetSymAxis() const
G4double GetXHalfLength3() const
G4double GetOuterRadiusMinusZ() const
G4PolyhedraHistorical * GetOriginalParameters() const
G4double GetDeltaPhiAngle() const
G4double GetOuterRadiusPlusZ() const
void Box_dimensionsWrite(xercesc::DOMElement *, const G4Box *const)
G4double GetZHalfLength() const
G4double GetYHalfLength2() const
G4double GetZHalfLength() const
void Ellipsoid_dimensionsWrite(xercesc::DOMElement *, const G4Ellipsoid *const)
G4double GetXHalfLength2() const
virtual void ParamvolAlgorithmWrite(xercesc::DOMElement *paramvolElement, const G4VPhysicalVolume *const paramvol)
virtual G4int GetMultiplicity() const
void Para_dimensionsWrite(xercesc::DOMElement *, const G4Para *const)
void Sphere_dimensionsWrite(xercesc::DOMElement *, const G4Sphere *const)
G4double GetXHalfLength1() const
G4ThreeVector GetAngles(const G4RotationMatrix &)
virtual ~G4GDMLWriteParamvol()
void Hype_dimensionsWrite(xercesc::DOMElement *, const G4Hype *const)
G4double GetInnerRadius() const
void Trd_dimensionsWrite(xercesc::DOMElement *, const G4Trd *const)
static const G4double alpha
G4RotationMatrix GetObjectRotationValue() const
void Polyhedra_dimensionsWrite(xercesc::DOMElement *, const G4Polyhedra *const)
G4double GetInnerRadiusPlusZ() const
void Torus_dimensionsWrite(xercesc::DOMElement *, const G4Torus *const)
G4double GetZHalfLength() const
virtual void ParamvolWrite(xercesc::DOMElement *, const G4VPhysicalVolume *const)
G4double GetStartPhiAngle() const
G4double GetXHalfLength() const
G4double GetZBottomCut() const
G4double GetYHalfLength1() const
G4double GetStartThetaAngle() const
void Polycone_dimensionsWrite(xercesc::DOMElement *, const G4Polycone *const)
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *description)
void Trap_dimensionsWrite(xercesc::DOMElement *, const G4Trap *const)
G4double GetXHalfLength2() const
G4double GetDeltaPhiAngle() const
G4double GetStartPhiAngle() const
G4double GetDeltaThetaAngle() const
G4double GetInnerRadius() const
G4double GetStartPhiAngle() const
static constexpr double degree
G4double GetOuterRadius() const
G4double GetTanAlpha2() const
G4double GetZTopCut() const
G4double GetDeltaPhiAngle() const
xercesc::DOMAttr * NewAttribute(const G4String &, const G4String &)
G4double GetInnerStereo() const
G4VSolid * GetSolid() const
void Cone_dimensionsWrite(xercesc::DOMElement *, const G4Cons *const)
G4PolyconeHistorical * GetOriginalParameters() const
G4double GetYHalfLength1() const
void RotationWrite(xercesc::DOMElement *element, const G4String &name, const G4ThreeVector &rot)
G4double GetZHalfLength() const
G4ThreeVector GetObjectTranslation() const
G4double GetZHalfLength() const
void Orb_dimensionsWrite(xercesc::DOMElement *, const G4Orb *const)
G4double GetZHalfLength() const
G4double GetOuterRadius() const
virtual void ComputeTransformation(const G4int, G4VPhysicalVolume *) const =0
void PositionWrite(xercesc::DOMElement *element, const G4String &name, const G4ThreeVector &pos)
const G4String & GetName() const
G4double GetYHalfLength() const
G4double GetInnerRadius() const
const G4String & GetName() const