66 xercesc::DOMElement* parametersElement,
const G4Box*
const box)
68 xercesc::DOMElement* box_dimensionsElement =
NewElement(
"box_dimensions");
69 box_dimensionsElement->setAttributeNode(
71 box_dimensionsElement->setAttributeNode(
73 box_dimensionsElement->setAttributeNode(
75 box_dimensionsElement->setAttributeNode(
NewAttribute(
"lunit",
"mm"));
76 parametersElement->appendChild(box_dimensionsElement);
81 xercesc::DOMElement* parametersElement,
const G4Trd*
const trd)
83 xercesc::DOMElement* trd_dimensionsElement =
NewElement(
"trd_dimensions");
84 trd_dimensionsElement->setAttributeNode(
86 trd_dimensionsElement->setAttributeNode(
88 trd_dimensionsElement->setAttributeNode(
90 trd_dimensionsElement->setAttributeNode(
92 trd_dimensionsElement->setAttributeNode(
94 trd_dimensionsElement->setAttributeNode(
NewAttribute(
"lunit",
"mm"));
95 parametersElement->appendChild(trd_dimensionsElement);
100 xercesc::DOMElement* parametersElement,
const G4Trap*
const trap)
104 (simaxis.
z() != 1.0) ? (std::atan(simaxis.
y() / simaxis.
x())) : (0.0);
105 const G4double theta = std::acos(simaxis.
z());
109 xercesc::DOMElement* trap_dimensionsElement =
NewElement(
"trap");
110 trap_dimensionsElement->setAttributeNode(
112 trap_dimensionsElement->setAttributeNode(
115 trap_dimensionsElement->setAttributeNode(
117 trap_dimensionsElement->setAttributeNode(
119 trap_dimensionsElement->setAttributeNode(
121 trap_dimensionsElement->setAttributeNode(
123 trap_dimensionsElement->setAttributeNode(
125 trap_dimensionsElement->setAttributeNode(
127 trap_dimensionsElement->setAttributeNode(
129 trap_dimensionsElement->setAttributeNode(
131 trap_dimensionsElement->setAttributeNode(
NewAttribute(
"aunit",
"deg"));
132 trap_dimensionsElement->setAttributeNode(
NewAttribute(
"lunit",
"mm"));
133 parametersElement->appendChild(trap_dimensionsElement);
138 xercesc::DOMElement* parametersElement,
const G4Tubs*
const tube)
140 xercesc::DOMElement* tube_dimensionsElement =
NewElement(
"tube_dimensions");
141 tube_dimensionsElement->setAttributeNode(
143 tube_dimensionsElement->setAttributeNode(
145 tube_dimensionsElement->setAttributeNode(
147 tube_dimensionsElement->setAttributeNode(
149 tube_dimensionsElement->setAttributeNode(
151 tube_dimensionsElement->setAttributeNode(
NewAttribute(
"aunit",
"deg"));
152 tube_dimensionsElement->setAttributeNode(
NewAttribute(
"lunit",
"mm"));
153 parametersElement->appendChild(tube_dimensionsElement);
158 xercesc::DOMElement* parametersElement,
const G4Cons*
const cone)
160 xercesc::DOMElement* cone_dimensionsElement =
NewElement(
"cone_dimensions");
161 cone_dimensionsElement->setAttributeNode(
163 cone_dimensionsElement->setAttributeNode(
165 cone_dimensionsElement->setAttributeNode(
167 cone_dimensionsElement->setAttributeNode(
169 cone_dimensionsElement->setAttributeNode(
171 cone_dimensionsElement->setAttributeNode(
173 cone_dimensionsElement->setAttributeNode(
175 cone_dimensionsElement->setAttributeNode(
NewAttribute(
"aunit",
"deg"));
176 cone_dimensionsElement->setAttributeNode(
NewAttribute(
"lunit",
"mm"));
177 parametersElement->appendChild(cone_dimensionsElement);
182 xercesc::DOMElement* parametersElement,
const G4Sphere*
const sphere)
184 xercesc::DOMElement* sphere_dimensionsElement =
186 sphere_dimensionsElement->setAttributeNode(
188 sphere_dimensionsElement->setAttributeNode(
190 sphere_dimensionsElement->setAttributeNode(
192 sphere_dimensionsElement->setAttributeNode(
194 sphere_dimensionsElement->setAttributeNode(
196 sphere_dimensionsElement->setAttributeNode(
198 sphere_dimensionsElement->setAttributeNode(
NewAttribute(
"aunit",
"deg"));
199 sphere_dimensionsElement->setAttributeNode(
NewAttribute(
"lunit",
"mm"));
200 parametersElement->appendChild(sphere_dimensionsElement);
205 xercesc::DOMElement* parametersElement,
const G4Orb*
const orb)
207 xercesc::DOMElement* orb_dimensionsElement =
NewElement(
"orb_dimensions");
208 orb_dimensionsElement->setAttributeNode(
210 orb_dimensionsElement->setAttributeNode(
NewAttribute(
"lunit",
"mm"));
211 parametersElement->appendChild(orb_dimensionsElement);
216 xercesc::DOMElement* parametersElement,
const G4Torus*
const torus)
218 xercesc::DOMElement* torus_dimensionsElement =
NewElement(
"torus_dimensions");
219 torus_dimensionsElement->setAttributeNode(
221 torus_dimensionsElement->setAttributeNode(
223 torus_dimensionsElement->setAttributeNode(
225 torus_dimensionsElement->setAttributeNode(
227 torus_dimensionsElement->setAttributeNode(
229 torus_dimensionsElement->setAttributeNode(
NewAttribute(
"aunit",
"deg"));
230 torus_dimensionsElement->setAttributeNode(
NewAttribute(
"lunit",
"mm"));
231 parametersElement->appendChild(torus_dimensionsElement);
236 xercesc::DOMElement* parametersElement,
const G4Ellipsoid*
const ellipsoid)
238 xercesc::DOMElement* ellipsoid_dimensionsElement =
240 ellipsoid_dimensionsElement->setAttributeNode(
242 ellipsoid_dimensionsElement->setAttributeNode(
244 ellipsoid_dimensionsElement->setAttributeNode(
246 ellipsoid_dimensionsElement->setAttributeNode(
248 ellipsoid_dimensionsElement->setAttributeNode(
250 ellipsoid_dimensionsElement->setAttributeNode(
NewAttribute(
"lunit",
"mm"));
251 parametersElement->appendChild(ellipsoid_dimensionsElement);
256 xercesc::DOMElement* parametersElement,
const G4Para*
const para)
261 const G4double theta = std::acos(simaxis.
z());
263 (simaxis.
z() != 1.0) ? (std::atan(simaxis.
y() / simaxis.
x())) : (0.0);
265 xercesc::DOMElement* para_dimensionsElement =
NewElement(
"para_dimensions");
266 para_dimensionsElement->setAttributeNode(
268 para_dimensionsElement->setAttributeNode(
270 para_dimensionsElement->setAttributeNode(
272 para_dimensionsElement->setAttributeNode(
274 para_dimensionsElement->setAttributeNode(
277 para_dimensionsElement->setAttributeNode(
NewAttribute(
"aunit",
"deg"));
278 para_dimensionsElement->setAttributeNode(
NewAttribute(
"lunit",
"mm"));
279 parametersElement->appendChild(para_dimensionsElement);
284 xercesc::DOMElement* parametersElement,
const G4Hype*
const hype)
286 xercesc::DOMElement* hype_dimensionsElement =
NewElement(
"hype_dimensions");
287 hype_dimensionsElement->setAttributeNode(
289 hype_dimensionsElement->setAttributeNode(
291 hype_dimensionsElement->setAttributeNode(
293 hype_dimensionsElement->setAttributeNode(
295 hype_dimensionsElement->setAttributeNode(
297 hype_dimensionsElement->setAttributeNode(
NewAttribute(
"aunit",
"deg"));
298 hype_dimensionsElement->setAttributeNode(
NewAttribute(
"lunit",
"mm"));
299 parametersElement->appendChild(hype_dimensionsElement);
304 xercesc::DOMElement* parametersElement,
const G4Polycone*
const pcone)
306 xercesc::DOMElement* pcone_dimensionsElement =
309 pcone_dimensionsElement->setAttributeNode(
315 pcone_dimensionsElement->setAttributeNode(
NewAttribute(
"aunit",
"deg"));
316 pcone_dimensionsElement->setAttributeNode(
NewAttribute(
"lunit",
"mm"));
318 parametersElement->appendChild(pcone_dimensionsElement);
324 for(std::size_t i = 0; i < num_zplanes; ++i)
326 ZplaneWrite(pcone_dimensionsElement, z_array[i], rmin_array[i],
333 xercesc::DOMElement* parametersElement,
const G4Polyhedra*
const polyhedra)
335 xercesc::DOMElement* polyhedra_dimensionsElement =
338 polyhedra_dimensionsElement->setAttributeNode(
340 polyhedra_dimensionsElement->setAttributeNode(
342 polyhedra_dimensionsElement->setAttributeNode(
NewAttribute(
344 polyhedra_dimensionsElement->setAttributeNode(
NewAttribute(
346 polyhedra_dimensionsElement->setAttributeNode(
NewAttribute(
"aunit",
"deg"));
347 polyhedra_dimensionsElement->setAttributeNode(
NewAttribute(
"lunit",
"mm"));
349 parametersElement->appendChild(polyhedra_dimensionsElement);
355 for(std::size_t i = 0; i < num_zplanes; ++i)
357 ZplaneWrite(polyhedra_dimensionsElement, z_array[i], rmin_array[i],
370 std::stringstream os;
375 xercesc::DOMElement* parametersElement =
NewElement(
"parameters");
376 parametersElement->setAttributeNode(
NewAttribute(
"number", index + 1));
386 paramvolElement->appendChild(parametersElement);
396 else if(
G4Trd* trd =
dynamic_cast<G4Trd*
>(solid))
426 else if(
G4Orb* orb =
dynamic_cast<G4Orb*
>(solid))
471 "' cannot be used in parameterised volume!";
472 G4Exception(
"G4GDMLWriteParamvol::ParametersWrite()",
"InvalidSetup",
483 xercesc::DOMElement* paramvolElement =
NewElement(
"paramvol");
484 paramvolElement->setAttributeNode(
486 xercesc::DOMElement* volumerefElement =
NewElement(
"volumeref");
487 volumerefElement->setAttributeNode(
NewAttribute(
"ref", volumeref));
489 xercesc::DOMElement* algorithmElement =
491 paramvolElement->appendChild(volumerefElement);
492 paramvolElement->appendChild(algorithmElement);
494 volumeElement->appendChild(paramvolElement);
506 for(
G4int i = 0; i < parameterCount; ++i)
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *description)
static const G4double alpha
static constexpr double mm
static constexpr double degree
G4double GetYHalfLength() const
G4double GetZHalfLength() const
G4double GetXHalfLength() const
G4double GetOuterRadiusPlusZ() const
G4double GetStartPhiAngle() const
G4double GetDeltaPhiAngle() const
G4double GetInnerRadiusMinusZ() const
G4double GetInnerRadiusPlusZ() const
G4double GetOuterRadiusMinusZ() const
G4double GetZHalfLength() const
G4double GetSemiAxisMax(G4int i) const
G4double GetZTopCut() const
G4double GetZBottomCut() const
void RotationWrite(xercesc::DOMElement *element, const G4String &name, const G4ThreeVector &rot)
void PositionWrite(xercesc::DOMElement *element, const G4String &name, const G4ThreeVector &pos)
G4ThreeVector GetAngles(const G4RotationMatrix &)
void Tube_dimensionsWrite(xercesc::DOMElement *, const G4Tubs *const)
void ParametersWrite(xercesc::DOMElement *, const G4VPhysicalVolume *const, const G4int &)
void Orb_dimensionsWrite(xercesc::DOMElement *, const G4Orb *const)
void Trap_dimensionsWrite(xercesc::DOMElement *, const G4Trap *const)
void Polycone_dimensionsWrite(xercesc::DOMElement *, const G4Polycone *const)
virtual ~G4GDMLWriteParamvol()
virtual void ParamvolAlgorithmWrite(xercesc::DOMElement *paramvolElement, const G4VPhysicalVolume *const paramvol)
void Hype_dimensionsWrite(xercesc::DOMElement *, const G4Hype *const)
void Ellipsoid_dimensionsWrite(xercesc::DOMElement *, const G4Ellipsoid *const)
void Polyhedra_dimensionsWrite(xercesc::DOMElement *, const G4Polyhedra *const)
void Trd_dimensionsWrite(xercesc::DOMElement *, const G4Trd *const)
void Box_dimensionsWrite(xercesc::DOMElement *, const G4Box *const)
void Cone_dimensionsWrite(xercesc::DOMElement *, const G4Cons *const)
void Sphere_dimensionsWrite(xercesc::DOMElement *, const G4Sphere *const)
void Para_dimensionsWrite(xercesc::DOMElement *, const G4Para *const)
virtual void ParamvolWrite(xercesc::DOMElement *, const G4VPhysicalVolume *const)
void Torus_dimensionsWrite(xercesc::DOMElement *, const G4Torus *const)
void ZplaneWrite(xercesc::DOMElement *, const G4double &, const G4double &, const G4double &)
xercesc::DOMElement * NewElement(const G4String &)
G4String GenerateName(const G4String &, const void *const)
xercesc::DOMAttr * NewAttribute(const G4String &, const G4String &)
G4double GetInnerStereo() const
G4double GetZHalfLength() const
G4double GetOuterStereo() const
G4double GetOuterRadius() const
G4double GetInnerRadius() const
G4VSolid * GetSolid() const
const G4String & GetName() const
G4double GetRadius() const
G4double GetTanAlpha() const
G4ThreeVector GetSymAxis() const
G4double GetYHalfLength() const
G4double GetZHalfLength() const
G4double GetXHalfLength() const
G4PolyconeHistorical * GetOriginalParameters() const
G4PolyhedraHistorical * GetOriginalParameters() const
G4double GetStartPhiAngle() const
G4double GetDeltaPhiAngle() const
G4double GetInnerRadius() const
G4double GetOuterRadius() const
G4double GetDeltaThetaAngle() const
G4double GetStartThetaAngle() const
G4double GetYHalfLength1() const
G4double GetTanAlpha2() const
G4double GetXHalfLength2() const
G4ThreeVector GetSymAxis() const
G4double GetXHalfLength4() const
G4double GetZHalfLength() const
G4double GetYHalfLength2() const
G4double GetTanAlpha1() const
G4double GetXHalfLength3() const
G4double GetXHalfLength1() const
G4double GetXHalfLength2() const
G4double GetYHalfLength2() const
G4double GetXHalfLength1() const
G4double GetYHalfLength1() const
G4double GetZHalfLength() const
G4double GetZHalfLength() const
G4double GetInnerRadius() const
G4double GetOuterRadius() const
G4double GetStartPhiAngle() const
G4double GetDeltaPhiAngle() const
virtual void ComputeTransformation(const G4int, G4VPhysicalVolume *) const =0
virtual void ComputeDimensions(G4Box &, const G4int, const G4VPhysicalVolume *) const
G4LogicalVolume * GetLogicalVolume() const
G4RotationMatrix GetObjectRotationValue() const
virtual G4int GetMultiplicity() const
const G4String & GetName() const
virtual G4VPVParameterisation * GetParameterisation() const =0
G4ThreeVector GetObjectTranslation() const
const char * name(G4int ptype)