Geant4_10
G4GDMLReadSolids.cc
Go to the documentation of this file.
1 //
2 // ********************************************************************
3 // * License and Disclaimer *
4 // * *
5 // * The Geant4 software is copyright of the Copyright Holders of *
6 // * the Geant4 Collaboration. It is provided under the terms and *
7 // * conditions of the Geant4 Software License, included in the file *
8 // * LICENSE and available at http://cern.ch/geant4/license . These *
9 // * include a list of copyright holders. *
10 // * *
11 // * Neither the authors of this software system, nor their employing *
12 // * institutes,nor the agencies providing financial support for this *
13 // * work make any representation or warranty, express or implied, *
14 // * regarding this software system or assume any liability for its *
15 // * use. Please see the license in the file LICENSE and URL above *
16 // * for the full disclaimer and the limitation of liability. *
17 // * *
18 // * This code implementation is the result of the scientific and *
19 // * technical work of the GEANT4 collaboration. *
20 // * By using, copying, modifying or distributing the software (or *
21 // * any work based on the software) you agree to acknowledge its *
22 // * use in resulting scientific publications, and indicate your *
23 // * acceptance of all terms of the Geant4 Software license. *
24 // ********************************************************************
25 //
26 // $Id: G4GDMLReadSolids.cc 77528 2013-11-25 13:06:36Z gcosmo $
27 //
28 // class G4GDMLReadSolids Implementation
29 //
30 // Original author: Zoltan Torzsok, November 2007
31 //
32 // --------------------------------------------------------------------
33 
34 #include "G4GDMLReadSolids.hh"
35 #include "G4Box.hh"
36 #include "G4Cons.hh"
37 #include "G4Ellipsoid.hh"
38 #include "G4EllipticalCone.hh"
39 #include "G4EllipticalTube.hh"
40 #include "G4Hype.hh"
41 #include "G4IntersectionSolid.hh"
42 #include "G4Orb.hh"
43 #include "G4Para.hh"
44 #include "G4Paraboloid.hh"
45 #include "G4Polycone.hh"
46 #include "G4GenericPolycone.hh"
47 #include "G4Polyhedra.hh"
48 #include "G4QuadrangularFacet.hh"
49 #include "G4ReflectedSolid.hh"
50 #include "G4Sphere.hh"
51 #include "G4SolidStore.hh"
52 #include "G4SubtractionSolid.hh"
53 #include "G4GenericTrap.hh"
54 #include "G4TessellatedSolid.hh"
55 #include "G4Tet.hh"
56 #include "G4Torus.hh"
57 #include "G4Transform3D.hh"
58 #include "G4Trap.hh"
59 #include "G4Trd.hh"
60 #include "G4TriangularFacet.hh"
61 #include "G4Tubs.hh"
62 #include "G4CutTubs.hh"
63 #include "G4TwistedBox.hh"
64 #include "G4TwistedTrap.hh"
65 #include "G4TwistedTrd.hh"
66 #include "G4TwistedTubs.hh"
67 #include "G4UnionSolid.hh"
68 #include "G4OpticalSurface.hh"
69 #include "G4SurfaceProperty.hh"
70 
72 {
73 }
74 
76 {
77 }
78 
80 BooleanRead(const xercesc::DOMElement* const booleanElement, const BooleanOp op)
81 {
82  G4String name;
84  G4String scnd;
85  G4ThreeVector position(0.0,0.0,0.0);
86  G4ThreeVector rotation(0.0,0.0,0.0);
87  G4ThreeVector firstposition(0.0,0.0,0.0);
88  G4ThreeVector firstrotation(0.0,0.0,0.0);
89 
90  const xercesc::DOMNamedNodeMap* const attributes
91  = booleanElement->getAttributes();
92  XMLSize_t attributeCount = attributes->getLength();
93 
94  for (XMLSize_t attribute_index=0;
95  attribute_index<attributeCount; attribute_index++)
96  {
97  xercesc::DOMNode* attribute_node = attributes->item(attribute_index);
98 
99  if (attribute_node->getNodeType() != xercesc::DOMNode::ATTRIBUTE_NODE)
100  { continue; }
101 
102  const xercesc::DOMAttr* const attribute
103  = dynamic_cast<xercesc::DOMAttr*>(attribute_node);
104  if (!attribute)
105  {
106  G4Exception("G4GDMLReadSolids::BooleanRead()",
107  "InvalidRead", FatalException, "No attribute found!");
108  return;
109  }
110  const G4String attName = Transcode(attribute->getName());
111  const G4String attValue = Transcode(attribute->getValue());
112 
113  if (attName=="name") { name = GenerateName(attValue); }
114  }
115 
116  for (xercesc::DOMNode* iter = booleanElement->getFirstChild();
117  iter != 0;iter = iter->getNextSibling())
118  {
119  if (iter->getNodeType() != xercesc::DOMNode::ELEMENT_NODE) { continue; }
120 
121  const xercesc::DOMElement* const child
122  = dynamic_cast<xercesc::DOMElement*>(iter);
123  if (!child)
124  {
125  G4Exception("G4GDMLReadSolids::BooleanRead()",
126  "InvalidRead", FatalException, "No child found!");
127  return;
128  }
129  const G4String tag = Transcode(child->getTagName());
130 
131  if (tag=="first") { first = RefRead(child); } else
132  if (tag=="second") { scnd = RefRead(child); } else
133  if (tag=="position") { VectorRead(child,position); } else
134  if (tag=="rotation") { VectorRead(child,rotation); } else
135  if (tag=="positionref")
136  { position = GetPosition(GenerateName(RefRead(child))); } else
137  if (tag=="rotationref")
138  { rotation = GetRotation(GenerateName(RefRead(child))); } else
139  if (tag=="firstposition") { VectorRead(child,firstposition); } else
140  if (tag=="firstrotation") { VectorRead(child,firstrotation); } else
141  if (tag=="firstpositionref")
142  { firstposition = GetPosition(GenerateName(RefRead(child))); } else
143  if (tag=="firstrotationref")
144  { firstrotation = GetRotation(GenerateName(RefRead(child))); }
145  else
146  {
147  G4String error_msg = "Unknown tag in boolean solid: " + tag;
148  G4Exception("G4GDMLReadSolids::BooleanRead()", "ReadError",
149  FatalException, error_msg);
150  }
151  }
152 
153  G4VSolid* firstSolid = GetSolid(GenerateName(first));
154  G4VSolid* secondSolid = GetSolid(GenerateName(scnd));
155 
156  G4Transform3D transform(GetRotationMatrix(rotation),position);
157 
158  if (( (firstrotation.x()!=0.0) || (firstrotation.y()!=0.0)
159  || (firstrotation.z()!=0.0))
160  || ( (firstposition.x()!=0.0) || (firstposition.y()!=0.0)
161  || (firstposition.z()!=0.0)))
162  {
163  G4Transform3D firsttransform(GetRotationMatrix(firstrotation),
164  firstposition);
165  firstSolid = new G4DisplacedSolid(GenerateName("displaced_"+first),
166  firstSolid, firsttransform);
167  }
168 
169  if (op==UNION)
170  { new G4UnionSolid(name,firstSolid,secondSolid,transform); } else
171  if (op==SUBTRACTION)
172  { new G4SubtractionSolid(name,firstSolid,secondSolid,transform); } else
173  if (op==INTERSECTION)
174  { new G4IntersectionSolid(name,firstSolid,secondSolid,transform); }
175 }
176 
177 void G4GDMLReadSolids::BoxRead(const xercesc::DOMElement* const boxElement)
178 {
179  G4String name;
180  G4double lunit = 1.0;
181  G4double x = 0.0;
182  G4double y = 0.0;
183  G4double z = 0.0;
184 
185  const xercesc::DOMNamedNodeMap* const attributes
186  = boxElement->getAttributes();
187  XMLSize_t attributeCount = attributes->getLength();
188 
189  for (XMLSize_t attribute_index=0;
190  attribute_index<attributeCount; attribute_index++)
191  {
192  xercesc::DOMNode* attribute_node = attributes->item(attribute_index);
193 
194  if (attribute_node->getNodeType() != xercesc::DOMNode::ATTRIBUTE_NODE)
195  { continue; }
196 
197  const xercesc::DOMAttr* const attribute
198  = dynamic_cast<xercesc::DOMAttr*>(attribute_node);
199  if (!attribute)
200  {
201  G4Exception("G4GDMLReadSolids::BoxRead()",
202  "InvalidRead", FatalException, "No attribute found!");
203  return;
204  }
205  const G4String attName = Transcode(attribute->getName());
206  const G4String attValue = Transcode(attribute->getValue());
207 
208  if (attName=="name") { name = GenerateName(attValue); } else
209  if (attName=="lunit") { lunit = eval.Evaluate(attValue); } else
210  if (attName=="x") { x = eval.Evaluate(attValue); } else
211  if (attName=="y") { y = eval.Evaluate(attValue); } else
212  if (attName=="z") { z = eval.Evaluate(attValue); }
213  }
214 
215  x *= 0.5*lunit;
216  y *= 0.5*lunit;
217  z *= 0.5*lunit;
218 
219  new G4Box(name,x,y,z);
220 }
221 
222 void G4GDMLReadSolids::ConeRead(const xercesc::DOMElement* const coneElement)
223 {
224  G4String name;
225  G4double lunit = 1.0;
226  G4double aunit = 1.0;
227  G4double rmin1 = 0.0;
228  G4double rmax1 = 0.0;
229  G4double rmin2 = 0.0;
230  G4double rmax2 = 0.0;
231  G4double z = 0.0;
232  G4double startphi = 0.0;
233  G4double deltaphi = 0.0;
234 
235  const xercesc::DOMNamedNodeMap* const attributes
236  = coneElement->getAttributes();
237  XMLSize_t attributeCount = attributes->getLength();
238 
239  for (XMLSize_t attribute_index=0;
240  attribute_index<attributeCount; attribute_index++)
241  {
242  xercesc::DOMNode* attribute_node = attributes->item(attribute_index);
243 
244  if (attribute_node->getNodeType() != xercesc::DOMNode::ATTRIBUTE_NODE)
245  { continue; }
246 
247  const xercesc::DOMAttr* const attribute
248  = dynamic_cast<xercesc::DOMAttr*>(attribute_node);
249  if (!attribute)
250  {
251  G4Exception("G4GDMLReadSolids::ConeRead()",
252  "InvalidRead", FatalException, "No attribute found!");
253  return;
254  }
255  const G4String attName = Transcode(attribute->getName());
256  const G4String attValue = Transcode(attribute->getValue());
257 
258  if (attName=="name") { name = GenerateName(attValue); } else
259  if (attName=="lunit") { lunit = eval.Evaluate(attValue); } else
260  if (attName=="aunit") { aunit = eval.Evaluate(attValue); } else
261  if (attName=="rmin1") { rmin1 = eval.Evaluate(attValue); } else
262  if (attName=="rmax1") { rmax1 = eval.Evaluate(attValue); } else
263  if (attName=="rmin2") { rmin2 = eval.Evaluate(attValue); } else
264  if (attName=="rmax2") { rmax2 = eval.Evaluate(attValue); } else
265  if (attName=="z") { z = eval.Evaluate(attValue); } else
266  if (attName=="startphi") { startphi = eval.Evaluate(attValue); } else
267  if (attName=="deltaphi") { deltaphi = eval.Evaluate(attValue); }
268  }
269 
270  rmin1 *= lunit;
271  rmax1 *= lunit;
272  rmin2 *= lunit;
273  rmax2 *= lunit;
274  z *= 0.5*lunit;
275  startphi *= aunit;
276  deltaphi *= aunit;
277 
278  new G4Cons(name,rmin1,rmax1,rmin2,rmax2,z,startphi,deltaphi);
279 }
280 
282 ElconeRead(const xercesc::DOMElement* const elconeElement)
283 {
284  G4String name;
285  G4double lunit = 1.0;
286  G4double dx = 0.0;
287  G4double dy = 0.0;
288  G4double zmax = 0.0;
289  G4double zcut = 0.0;
290 
291  const xercesc::DOMNamedNodeMap* const attributes
292  = elconeElement->getAttributes();
293  XMLSize_t attributeCount = attributes->getLength();
294 
295  for (XMLSize_t attribute_index=0;
296  attribute_index<attributeCount; attribute_index++)
297  {
298  xercesc::DOMNode* attribute_node = attributes->item(attribute_index);
299 
300  if (attribute_node->getNodeType() != xercesc::DOMNode::ATTRIBUTE_NODE)
301  { continue; }
302 
303  const xercesc::DOMAttr* const attribute
304  = dynamic_cast<xercesc::DOMAttr*>(attribute_node);
305  if (!attribute)
306  {
307  G4Exception("G4GDMLReadSolids::ElconeRead()",
308  "InvalidRead", FatalException, "No attribute found!");
309  return;
310  }
311  const G4String attName = Transcode(attribute->getName());
312  const G4String attValue = Transcode(attribute->getValue());
313 
314  if (attName=="name") { name = GenerateName(attValue); } else
315  if (attName=="lunit") { lunit = eval.Evaluate(attValue); } else
316  if (attName=="dx") { dx = eval.Evaluate(attValue); } else
317  if (attName=="dy") { dy = eval.Evaluate(attValue); } else
318  if (attName=="zmax") { zmax = eval.Evaluate(attValue); } else
319  if (attName=="zcut") { zcut = eval.Evaluate(attValue); }
320  }
321 
322  zmax *= lunit;
323  zcut *= lunit;
324 
325  new G4EllipticalCone(name,dx,dy,zmax,zcut);
326 }
327 
329 EllipsoidRead(const xercesc::DOMElement* const ellipsoidElement)
330 {
331  G4String name;
332  G4double lunit = 1.0;
333  G4double ax = 0.0;
334  G4double by = 0.0;
335  G4double cz = 0.0;
336  G4double zcut1 = 0.0;
337  G4double zcut2 = 0.0;
338 
339  const xercesc::DOMNamedNodeMap* const attributes
340  = ellipsoidElement->getAttributes();
341  XMLSize_t attributeCount = attributes->getLength();
342 
343  for (XMLSize_t attribute_index=0;
344  attribute_index<attributeCount; attribute_index++)
345  {
346  xercesc::DOMNode* attribute_node = attributes->item(attribute_index);
347 
348  if (attribute_node->getNodeType() != xercesc::DOMNode::ATTRIBUTE_NODE)
349  { continue; }
350 
351  const xercesc::DOMAttr* const attribute
352  = dynamic_cast<xercesc::DOMAttr*>(attribute_node);
353  if (!attribute)
354  {
355  G4Exception("G4GDMLReadSolids::EllipsoidRead()",
356  "InvalidRead", FatalException, "No attribute found!");
357  return;
358  }
359  const G4String attName = Transcode(attribute->getName());
360  const G4String attValue = Transcode(attribute->getValue());
361 
362  if (attName=="name") { name = GenerateName(attValue); } else
363  if (attName=="lunit") { lunit = eval.Evaluate(attValue); } else
364  if (attName=="ax") { ax = eval.Evaluate(attValue); } else
365  if (attName=="by") { by = eval.Evaluate(attValue); } else
366  if (attName=="cz") { cz = eval.Evaluate(attValue); } else
367  if (attName=="zcut1") { zcut1 = eval.Evaluate(attValue); } else
368  if (attName=="zcut2") { zcut2 = eval.Evaluate(attValue); }
369  }
370 
371  ax *= lunit;
372  by *= lunit;
373  cz *= lunit;
374  zcut1 *= lunit;
375  zcut2 *= lunit;
376 
377  new G4Ellipsoid(name,ax,by,cz,zcut1,zcut2);
378 }
379 
381 EltubeRead(const xercesc::DOMElement* const eltubeElement)
382 {
383  G4String name;
384  G4double lunit = 1.0;
385  G4double dx = 0.0;
386  G4double dy = 0.0;
387  G4double dz = 0.0;
388 
389  const xercesc::DOMNamedNodeMap* const attributes
390  = eltubeElement->getAttributes();
391  XMLSize_t attributeCount = attributes->getLength();
392 
393  for (XMLSize_t attribute_index=0;
394  attribute_index<attributeCount; attribute_index++)
395  {
396  xercesc::DOMNode* attribute_node = attributes->item(attribute_index);
397 
398  if (attribute_node->getNodeType() != xercesc::DOMNode::ATTRIBUTE_NODE)
399  { continue; }
400 
401  const xercesc::DOMAttr* const attribute
402  = dynamic_cast<xercesc::DOMAttr*>(attribute_node);
403  if (!attribute)
404  {
405  G4Exception("G4GDMLReadSolids::EltubeRead()",
406  "InvalidRead", FatalException, "No attribute found!");
407  return;
408  }
409  const G4String attName = Transcode(attribute->getName());
410  const G4String attValue = Transcode(attribute->getValue());
411 
412  if (attName=="name") { name = GenerateName(attValue); } else
413  if (attName=="lunit") { lunit = eval.Evaluate(attValue); } else
414  if (attName=="dx") { dx = eval.Evaluate(attValue); } else
415  if (attName=="dy") { dy = eval.Evaluate(attValue); } else
416  if (attName=="dz") { dz = eval.Evaluate(attValue); }
417  }
418 
419  dx *= lunit;
420  dy *= lunit;
421  dz *= lunit;
422 
423  new G4EllipticalTube(name,dx,dy,dz);
424 }
425 
426 void G4GDMLReadSolids::XtruRead(const xercesc::DOMElement* const xtruElement)
427 {
428  G4String name;
429  G4double lunit = 1.0;
430 
431  const xercesc::DOMNamedNodeMap* const attributes
432  = xtruElement->getAttributes();
433  XMLSize_t attributeCount = attributes->getLength();
434 
435  for (XMLSize_t attribute_index=0;
436  attribute_index<attributeCount; attribute_index++)
437  {
438  xercesc::DOMNode* attribute_node = attributes->item(attribute_index);
439 
440  if (attribute_node->getNodeType() != xercesc::DOMNode::ATTRIBUTE_NODE)
441  { continue; }
442 
443  const xercesc::DOMAttr* const attribute
444  = dynamic_cast<xercesc::DOMAttr*>(attribute_node);
445  if (!attribute)
446  {
447  G4Exception("G4GDMLReadSolids::XtruRead()",
448  "InvalidRead", FatalException, "No attribute found!");
449  return;
450  }
451  const G4String attName = Transcode(attribute->getName());
452  const G4String attValue = Transcode(attribute->getValue());
453 
454  if (attName=="name") { name = GenerateName(attValue); } else
455  if (attName=="lunit") { lunit = eval.Evaluate(attValue); }
456  }
457 
458  std::vector<G4TwoVector> twoDimVertexList;
459  std::vector<G4ExtrudedSolid::ZSection> sectionList;
460 
461  for (xercesc::DOMNode* iter = xtruElement->getFirstChild();
462  iter != 0; iter = iter->getNextSibling())
463  {
464  if (iter->getNodeType() != xercesc::DOMNode::ELEMENT_NODE) { continue; }
465 
466  const xercesc::DOMElement* const child
467  = dynamic_cast<xercesc::DOMElement*>(iter);
468  if (!child)
469  {
470  G4Exception("G4GDMLReadSolids::XtruRead()",
471  "InvalidRead", FatalException, "No child found!");
472  return;
473  }
474  const G4String tag = Transcode(child->getTagName());
475 
476  if (tag=="twoDimVertex")
477  { twoDimVertexList.push_back(TwoDimVertexRead(child,lunit)); } else
478  if (tag=="section")
479  { sectionList.push_back(SectionRead(child,lunit)); }
480  }
481 
482  new G4ExtrudedSolid(name,twoDimVertexList,sectionList);
483 }
484 
485 void G4GDMLReadSolids::HypeRead(const xercesc::DOMElement* const hypeElement)
486 {
487  G4String name;
488  G4double lunit = 1.0;
489  G4double aunit = 1.0;
490  G4double rmin = 0.0;
491  G4double rmax = 0.0;
492  G4double inst = 0.0;
493  G4double outst = 0.0;
494  G4double z = 0.0;
495 
496  const xercesc::DOMNamedNodeMap* const attributes
497  = hypeElement->getAttributes();
498  XMLSize_t attributeCount = attributes->getLength();
499 
500  for (XMLSize_t attribute_index=0;
501  attribute_index<attributeCount; attribute_index++)
502  {
503  xercesc::DOMNode* attribute_node = attributes->item(attribute_index);
504 
505  if (attribute_node->getNodeType() != xercesc::DOMNode::ATTRIBUTE_NODE)
506  { continue; }
507 
508  const xercesc::DOMAttr* const attribute
509  = dynamic_cast<xercesc::DOMAttr*>(attribute_node);
510  if (!attribute)
511  {
512  G4Exception("G4GDMLReadSolids::HypeRead()",
513  "InvalidRead", FatalException, "No attribute found!");
514  return;
515  }
516  const G4String attName = Transcode(attribute->getName());
517  const G4String attValue = Transcode(attribute->getValue());
518 
519  if (attName=="name") { name = GenerateName(attValue); } else
520  if (attName=="lunit") { lunit = eval.Evaluate(attValue); } else
521  if (attName=="aunit") { aunit = eval.Evaluate(attValue); } else
522  if (attName=="rmin") { rmin = eval.Evaluate(attValue); } else
523  if (attName=="rmax") { rmax = eval.Evaluate(attValue); } else
524  if (attName=="inst") { inst = eval.Evaluate(attValue); } else
525  if (attName=="outst") { outst = eval.Evaluate(attValue); } else
526  if (attName=="z") { z = eval.Evaluate(attValue); }
527  }
528 
529  rmin *= lunit;
530  rmax *= lunit;
531  inst *= aunit;
532  outst *= aunit;
533  z *= 0.5*lunit;
534 
535  new G4Hype(name,rmin,rmax,inst,outst,z);
536 }
537 
538 void G4GDMLReadSolids::MultiUnionRead(const xercesc::DOMElement* const)
539 {
540  G4Exception("G4GDMLReadSolids::MultiUnionRead()",
541  "InvalidSetup", JustWarning,
542  "MultiUnion is not supported yet. Sorry!");
543 }
544 
545 void G4GDMLReadSolids::OrbRead(const xercesc::DOMElement* const orbElement)
546 {
547  G4String name;
548  G4double lunit = 1.0;
549  G4double r = 0.0;
550 
551  const xercesc::DOMNamedNodeMap* const attributes
552  = orbElement->getAttributes();
553  XMLSize_t attributeCount = attributes->getLength();
554 
555  for (XMLSize_t attribute_index=0;
556  attribute_index<attributeCount; attribute_index++)
557  {
558  xercesc::DOMNode* attribute_node = attributes->item(attribute_index);
559 
560  if (attribute_node->getNodeType() != xercesc::DOMNode::ATTRIBUTE_NODE)
561  { continue; }
562 
563  const xercesc::DOMAttr* const attribute
564  = dynamic_cast<xercesc::DOMAttr*>(attribute_node);
565  if (!attribute)
566  {
567  G4Exception("G4GDMLReadSolids::OrbRead()",
568  "InvalidRead", FatalException, "No attribute found!");
569  return;
570  }
571  const G4String attName = Transcode(attribute->getName());
572  const G4String attValue = Transcode(attribute->getValue());
573 
574  if (attName=="name") { name = GenerateName(attValue); } else
575  if (attName=="lunit") { lunit = eval.Evaluate(attValue); } else
576  if (attName=="r") { r = eval.Evaluate(attValue); }
577  }
578 
579  r *= lunit;
580 
581  new G4Orb(name,r);
582 }
583 
584 void G4GDMLReadSolids::ParaRead(const xercesc::DOMElement* const paraElement)
585 {
586  G4String name;
587  G4double lunit = 1.0;
588  G4double aunit = 1.0;
589  G4double x = 0.0;
590  G4double y = 0.0;
591  G4double z = 0.0;
592  G4double alpha = 0.0;
593  G4double theta = 0.0;
594  G4double phi = 0.0;
595 
596  const xercesc::DOMNamedNodeMap* const attributes
597  = paraElement->getAttributes();
598  XMLSize_t attributeCount = attributes->getLength();
599 
600  for (XMLSize_t attribute_index=0;
601  attribute_index<attributeCount; attribute_index++)
602  {
603  xercesc::DOMNode* attribute_node = attributes->item(attribute_index);
604 
605  if (attribute_node->getNodeType() != xercesc::DOMNode::ATTRIBUTE_NODE)
606  { continue; }
607 
608  const xercesc::DOMAttr* const attribute
609  = dynamic_cast<xercesc::DOMAttr*>(attribute_node);
610  if (!attribute)
611  {
612  G4Exception("G4GDMLReadSolids::ParaRead()",
613  "InvalidRead", FatalException, "No attribute found!");
614  return;
615  }
616  const G4String attName = Transcode(attribute->getName());
617  const G4String attValue = Transcode(attribute->getValue());
618 
619  if (attName=="name") { name = GenerateName(attValue); } else
620  if (attName=="lunit") { lunit = eval.Evaluate(attValue); } else
621  if (attName=="aunit") { aunit = eval.Evaluate(attValue); } else
622  if (attName=="x") { x = eval.Evaluate(attValue); } else
623  if (attName=="y") { y = eval.Evaluate(attValue); } else
624  if (attName=="z") { z = eval.Evaluate(attValue); } else
625  if (attName=="alpha") { alpha = eval.Evaluate(attValue); } else
626  if (attName=="theta") { theta = eval.Evaluate(attValue); } else
627  if (attName=="phi") { phi = eval.Evaluate(attValue); }
628  }
629 
630  x *= 0.5*lunit;
631  y *= 0.5*lunit;
632  z *= 0.5*lunit;
633  alpha *= aunit;
634  theta *= aunit;
635  phi *= aunit;
636 
637  new G4Para(name,x,y,z,alpha,theta,phi);
638 }
639 
641 ParaboloidRead(const xercesc::DOMElement* const paraElement)
642 {
643  G4String name;
644  G4double lunit = 1.0;
645  G4double rlo = 0.0;
646  G4double rhi = 0.0;
647  G4double dz = 0.0;
648 
649  const xercesc::DOMNamedNodeMap* const attributes
650  = paraElement->getAttributes();
651  XMLSize_t attributeCount = attributes->getLength();
652 
653  for (XMLSize_t attribute_index=0;
654  attribute_index<attributeCount; attribute_index++)
655  {
656  xercesc::DOMNode* attribute_node = attributes->item(attribute_index);
657 
658  if (attribute_node->getNodeType() != xercesc::DOMNode::ATTRIBUTE_NODE)
659  { continue; }
660 
661  const xercesc::DOMAttr* const attribute
662  = dynamic_cast<xercesc::DOMAttr*>(attribute_node);
663  if (!attribute)
664  {
665  G4Exception("G4GDMLReadSolids::ParaboloidRead()",
666  "InvalidRead", FatalException, "No attribute found!");
667  return;
668  }
669  const G4String attName = Transcode(attribute->getName());
670  const G4String attValue = Transcode(attribute->getValue());
671 
672  if (attName=="name") { name = GenerateName(attValue); } else
673  if (attName=="lunit") { lunit = eval.Evaluate(attValue); } else
674  if (attName=="rlo") { rlo = eval.Evaluate(attValue); } else
675  if (attName=="rhi") { rhi = eval.Evaluate(attValue); } else
676  if (attName=="dz") { dz = eval.Evaluate(attValue); }
677  }
678 
679  rlo *= 1.*lunit;
680  rhi *= 1.*lunit;
681  dz *= 1.*lunit;
682 
683  new G4Paraboloid(name,dz,rlo,rhi);
684 }
685 
687 PolyconeRead(const xercesc::DOMElement* const polyconeElement)
688 {
689  G4String name;
690  G4double lunit = 1.0;
691  G4double aunit = 1.0;
692  G4double startphi = 0.0;
693  G4double deltaphi = 0.0;
694 
695  const xercesc::DOMNamedNodeMap* const attributes
696  = polyconeElement->getAttributes();
697  XMLSize_t attributeCount = attributes->getLength();
698 
699  for (XMLSize_t attribute_index=0;
700  attribute_index<attributeCount; attribute_index++)
701  {
702  xercesc::DOMNode* attribute_node = attributes->item(attribute_index);
703 
704  if (attribute_node->getNodeType() != xercesc::DOMNode::ATTRIBUTE_NODE)
705  { continue; }
706 
707  const xercesc::DOMAttr* const attribute
708  = dynamic_cast<xercesc::DOMAttr*>(attribute_node);
709  if (!attribute)
710  {
711  G4Exception("G4GDMLReadSolids::PolyconeRead()",
712  "InvalidRead", FatalException, "No attribute found!");
713  return;
714  }
715  const G4String attName = Transcode(attribute->getName());
716  const G4String attValue = Transcode(attribute->getValue());
717 
718  if (attName=="name") { name = GenerateName(attValue); } else
719  if (attName=="lunit") { lunit = eval.Evaluate(attValue); } else
720  if (attName=="aunit") { aunit = eval.Evaluate(attValue); } else
721  if (attName=="startphi") { startphi = eval.Evaluate(attValue); }else
722  if (attName=="deltaphi") { deltaphi = eval.Evaluate(attValue); }
723  }
724 
725  startphi *= aunit;
726  deltaphi *= aunit;
727 
728  std::vector<zplaneType> zplaneList;
729 
730  for (xercesc::DOMNode* iter = polyconeElement->getFirstChild();
731  iter != 0; iter = iter->getNextSibling())
732  {
733  if (iter->getNodeType() != xercesc::DOMNode::ELEMENT_NODE) { continue; }
734 
735  const xercesc::DOMElement* const child
736  = dynamic_cast<xercesc::DOMElement*>(iter);
737  if (!child)
738  {
739  G4Exception("G4GDMLReadSolids::PolyconeRead()",
740  "InvalidRead", FatalException, "No child found!");
741  return;
742  }
743  const G4String tag = Transcode(child->getTagName());
744 
745  if (tag=="zplane") { zplaneList.push_back(ZplaneRead(child)); }
746  }
747 
748  G4int numZPlanes = zplaneList.size();
749 
750  G4double* rmin_array = new G4double[numZPlanes];
751  G4double* rmax_array = new G4double[numZPlanes];
752  G4double* z_array = new G4double[numZPlanes];
753 
754  for (G4int i=0; i<numZPlanes; i++)
755  {
756  rmin_array[i] = zplaneList[i].rmin*lunit;
757  rmax_array[i] = zplaneList[i].rmax*lunit;
758  z_array[i] = zplaneList[i].z*lunit;
759  }
760 
761  new G4Polycone(name,startphi,deltaphi,numZPlanes,
762  z_array,rmin_array,rmax_array);
763 }
764 
766 GenericPolyconeRead(const xercesc::DOMElement* const polyconeElement)
767 {
768  G4String name;
769  G4double lunit = 1.0;
770  G4double aunit = 1.0;
771  G4double startphi = 0.0;
772  G4double deltaphi = 0.0;
773 
774  const xercesc::DOMNamedNodeMap* const attributes
775  = polyconeElement->getAttributes();
776  XMLSize_t attributeCount = attributes->getLength();
777 
778  for (XMLSize_t attribute_index=0;
779  attribute_index<attributeCount; attribute_index++)
780  {
781  xercesc::DOMNode* attribute_node = attributes->item(attribute_index);
782 
783  if (attribute_node->getNodeType() != xercesc::DOMNode::ATTRIBUTE_NODE)
784  { continue; }
785 
786  const xercesc::DOMAttr* const attribute
787  = dynamic_cast<xercesc::DOMAttr*>(attribute_node);
788  if (!attribute)
789  {
790  G4Exception("G4GDMLReadSolids::GenericPolyconeRead()",
791  "InvalidRead", FatalException, "No attribute found!");
792  return;
793  }
794  const G4String attName = Transcode(attribute->getName());
795  const G4String attValue = Transcode(attribute->getValue());
796 
797  if (attName=="name") { name = GenerateName(attValue); } else
798  if (attName=="lunit") { lunit = eval.Evaluate(attValue); } else
799  if (attName=="aunit") { aunit = eval.Evaluate(attValue); } else
800  if (attName=="startphi") { startphi = eval.Evaluate(attValue); }else
801  if (attName=="deltaphi") { deltaphi = eval.Evaluate(attValue); }
802  }
803 
804  startphi *= aunit;
805  deltaphi *= aunit;
806 
807  std::vector<rzPointType> rzPointList;
808 
809  for (xercesc::DOMNode* iter = polyconeElement->getFirstChild();
810  iter != 0; iter = iter->getNextSibling())
811  {
812  if (iter->getNodeType() != xercesc::DOMNode::ELEMENT_NODE) { continue; }
813 
814  const xercesc::DOMElement* const child
815  = dynamic_cast<xercesc::DOMElement*>(iter);
816  if (!child)
817  {
818  G4Exception("G4GDMLReadSolids::GenericPolyconeRead()",
819  "InvalidRead", FatalException, "No child found!");
820  return;
821  }
822  const G4String tag = Transcode(child->getTagName());
823 
824  if (tag=="rzpoint") { rzPointList.push_back(RZPointRead(child)); }
825  }
826 
827  G4int numRZPoints = rzPointList.size();
828 
829  G4double* r_array = new G4double[numRZPoints];
830  G4double* z_array = new G4double[numRZPoints];
831 
832  for (G4int i=0; i<numRZPoints; i++)
833  {
834  r_array[i] = rzPointList[i].r*lunit;
835  z_array[i] = rzPointList[i].z*lunit;
836  }
837  new G4GenericPolycone(name,startphi,deltaphi,numRZPoints,
838  r_array,z_array);
839 }
840 
842 PolyhedraRead(const xercesc::DOMElement* const polyhedraElement)
843 {
844  G4String name;
845  G4double lunit = 1.0;
846  G4double aunit = 1.0;
847  G4double startphi = 0.0;
848  G4double deltaphi = 0.0;
849  G4int numsides = 0;
850 
851  const xercesc::DOMNamedNodeMap* const attributes
852  = polyhedraElement->getAttributes();
853  XMLSize_t attributeCount = attributes->getLength();
854 
855  for (XMLSize_t attribute_index=0;
856  attribute_index<attributeCount; attribute_index++)
857  {
858  xercesc::DOMNode* attribute_node = attributes->item(attribute_index);
859 
860  if (attribute_node->getNodeType() != xercesc::DOMNode::ATTRIBUTE_NODE)
861  { continue; }
862 
863  const xercesc::DOMAttr* const attribute
864  = dynamic_cast<xercesc::DOMAttr*>(attribute_node);
865  if (!attribute)
866  {
867  G4Exception("G4GDMLReadSolids::PolyhedraRead()",
868  "InvalidRead", FatalException, "No attribute found!");
869  return;
870  }
871  const G4String attName = Transcode(attribute->getName());
872  const G4String attValue = Transcode(attribute->getValue());
873 
874  if (attName=="name") { name = GenerateName(attValue); } else
875  if (attName=="lunit") { lunit = eval.Evaluate(attValue); } else
876  if (attName=="aunit") { aunit = eval.Evaluate(attValue); } else
877  if (attName=="startphi") { startphi = eval.Evaluate(attValue); } else
878  if (attName=="deltaphi") { deltaphi = eval.Evaluate(attValue); } else
879  if (attName=="numsides") { numsides = eval.EvaluateInteger(attValue); }
880  }
881 
882  startphi *= aunit;
883  deltaphi *= aunit;
884 
885  std::vector<zplaneType> zplaneList;
886 
887  for (xercesc::DOMNode* iter = polyhedraElement->getFirstChild();
888  iter != 0; iter = iter->getNextSibling())
889  {
890  if (iter->getNodeType() != xercesc::DOMNode::ELEMENT_NODE) { continue; }
891 
892  const xercesc::DOMElement* const child
893  = dynamic_cast<xercesc::DOMElement*>(iter);
894  if (!child)
895  {
896  G4Exception("G4GDMLReadSolids::PolyhedraRead()",
897  "InvalidRead", FatalException, "No child found!");
898  return;
899  }
900  const G4String tag = Transcode(child->getTagName());
901 
902  if (tag=="zplane") { zplaneList.push_back(ZplaneRead(child)); }
903  }
904 
905  G4int numZPlanes = zplaneList.size();
906 
907  G4double* rmin_array = new G4double[numZPlanes];
908  G4double* rmax_array = new G4double[numZPlanes];
909  G4double* z_array = new G4double[numZPlanes];
910 
911  for (G4int i=0; i<numZPlanes; i++)
912  {
913  rmin_array[i] = zplaneList[i].rmin*lunit;
914  rmax_array[i] = zplaneList[i].rmax*lunit;
915  z_array[i] = zplaneList[i].z*lunit;
916  }
917 
918  new G4Polyhedra(name,startphi,deltaphi,numsides,numZPlanes,
919  z_array,rmin_array,rmax_array);
920 
921 }
922 
924 GenericPolyhedraRead(const xercesc::DOMElement* const polyhedraElement)
925 {
926  G4String name;
927  G4double lunit = 1.0;
928  G4double aunit = 1.0;
929  G4double startphi = 0.0;
930  G4double deltaphi = 0.0;
931  G4int numsides = 0;
932 
933  const xercesc::DOMNamedNodeMap* const attributes
934  = polyhedraElement->getAttributes();
935  XMLSize_t attributeCount = attributes->getLength();
936 
937  for (XMLSize_t attribute_index=0;
938  attribute_index<attributeCount; attribute_index++)
939  {
940  xercesc::DOMNode* attribute_node = attributes->item(attribute_index);
941 
942  if (attribute_node->getNodeType() != xercesc::DOMNode::ATTRIBUTE_NODE)
943  { continue; }
944 
945  const xercesc::DOMAttr* const attribute
946  = dynamic_cast<xercesc::DOMAttr*>(attribute_node);
947  if (!attribute)
948  {
949  G4Exception("G4GDMLReadSolids::GenericPolyhedraRead()",
950  "InvalidRead", FatalException, "No attribute found!");
951  return;
952  }
953  const G4String attName = Transcode(attribute->getName());
954  const G4String attValue = Transcode(attribute->getValue());
955 
956  if (attName=="name") { name = GenerateName(attValue); } else
957  if (attName=="lunit") { lunit = eval.Evaluate(attValue); } else
958  if (attName=="aunit") { aunit = eval.Evaluate(attValue); } else
959  if (attName=="startphi") { startphi = eval.Evaluate(attValue); } else
960  if (attName=="deltaphi") { deltaphi = eval.Evaluate(attValue); } else
961  if (attName=="numsides") { numsides = eval.EvaluateInteger(attValue); }
962  }
963 
964  startphi *= aunit;
965  deltaphi *= aunit;
966 
967  std::vector<rzPointType> rzpointList;
968 
969  for (xercesc::DOMNode* iter = polyhedraElement->getFirstChild();
970  iter != 0; iter = iter->getNextSibling())
971  {
972  if (iter->getNodeType() != xercesc::DOMNode::ELEMENT_NODE) { continue; }
973 
974  const xercesc::DOMElement* const child
975  = dynamic_cast<xercesc::DOMElement*>(iter);
976  if (!child)
977  {
978  G4Exception("G4GDMLReadSolids::GenericPolyhedraRead()",
979  "InvalidRead", FatalException, "No child found!");
980  return;
981  }
982  const G4String tag = Transcode(child->getTagName());
983 
984  if (tag=="rzpoint") { rzpointList.push_back(RZPointRead(child)); }
985  }
986 
987  G4int numRZPoints = rzpointList.size();
988 
989  G4double* r_array = new G4double[numRZPoints];
990  G4double* z_array = new G4double[numRZPoints];
991 
992 
993  for (G4int i=0; i<numRZPoints; i++)
994  {
995  r_array[i] = rzpointList[i].r*lunit;
996  z_array[i] = rzpointList[i].z*lunit;
997  }
998 
999  new G4Polyhedra(name,startphi,deltaphi,numsides,numRZPoints,
1000  r_array,z_array);
1001 
1002 }
1003 
1005 QuadrangularRead(const xercesc::DOMElement* const quadrangularElement)
1006 {
1007  G4ThreeVector vertex1;
1008  G4ThreeVector vertex2;
1009  G4ThreeVector vertex3;
1010  G4ThreeVector vertex4;
1011  G4FacetVertexType type = ABSOLUTE;
1012  G4double lunit = 1.0;
1013 
1014  const xercesc::DOMNamedNodeMap* const attributes
1015  = quadrangularElement->getAttributes();
1016  XMLSize_t attributeCount = attributes->getLength();
1017 
1018  for (XMLSize_t attribute_index=0;
1019  attribute_index<attributeCount; attribute_index++)
1020  {
1021  xercesc::DOMNode* attribute_node = attributes->item(attribute_index);
1022 
1023  if (attribute_node->getNodeType() != xercesc::DOMNode::ATTRIBUTE_NODE)
1024  { continue; }
1025 
1026  const xercesc::DOMAttr* const attribute
1027  = dynamic_cast<xercesc::DOMAttr*>(attribute_node);
1028  if (!attribute)
1029  {
1030  G4Exception("G4GDMLReadSolids::QuadrangularRead()",
1031  "InvalidRead", FatalException, "No attribute found!");
1032  return 0;
1033  }
1034  const G4String attName = Transcode(attribute->getName());
1035  const G4String attValue = Transcode(attribute->getValue());
1036 
1037  if (attName=="vertex1")
1038  { vertex1 = GetPosition(GenerateName(attValue)); } else
1039  if (attName=="vertex2")
1040  { vertex2 = GetPosition(GenerateName(attValue)); } else
1041  if (attName=="vertex3")
1042  { vertex3 = GetPosition(GenerateName(attValue)); } else
1043  if (attName=="vertex4")
1044  { vertex4 = GetPosition(GenerateName(attValue)); } else
1045  if (attName=="lunit")
1046  { lunit = eval.Evaluate(attValue); } else
1047  if (attName=="type")
1048  { if (attValue=="RELATIVE") { type = RELATIVE; } }
1049  }
1050 
1051  return new G4QuadrangularFacet(vertex1*lunit,vertex2*lunit,
1052  vertex3*lunit,vertex4*lunit,type);
1053 }
1054 
1055 void G4GDMLReadSolids::
1056 ReflectedSolidRead(const xercesc::DOMElement* const reflectedSolidElement)
1057 {
1058  G4String name;
1059  G4double lunit = 1.0;
1060  G4double aunit = 1.0;
1061  G4String solid;
1062  G4ThreeVector scale(1.0,1.0,1.0);
1063  G4ThreeVector rotation;
1065 
1066  const xercesc::DOMNamedNodeMap* const attributes
1067  = reflectedSolidElement->getAttributes();
1068  XMLSize_t attributeCount = attributes->getLength();
1069 
1070  for (XMLSize_t attribute_index=0;
1071  attribute_index<attributeCount; attribute_index++)
1072  {
1073  xercesc::DOMNode* attribute_node = attributes->item(attribute_index);
1074 
1075  if (attribute_node->getNodeType() != xercesc::DOMNode::ATTRIBUTE_NODE)
1076  { continue; }
1077 
1078  const xercesc::DOMAttr* const attribute
1079  = dynamic_cast<xercesc::DOMAttr*>(attribute_node);
1080  if (!attribute)
1081  {
1082  G4Exception("G4GDMLReadSolids::ReflectedSolidRead()",
1083  "InvalidRead", FatalException, "No attribute found!");
1084  return;
1085  }
1086  const G4String attName = Transcode(attribute->getName());
1087  const G4String attValue = Transcode(attribute->getValue());
1088 
1089  if (attName=="name") { name = GenerateName(attValue); } else
1090  if (attName=="lunit") { lunit = eval.Evaluate(attValue); } else
1091  if (attName=="aunit") { aunit = eval.Evaluate(attValue); } else
1092  if (attName=="solid") { solid = GenerateName(attValue); } else
1093  if (attName=="sx") { scale.setX(eval.Evaluate(attValue)); } else
1094  if (attName=="sy") { scale.setY(eval.Evaluate(attValue)); } else
1095  if (attName=="sz") { scale.setZ(eval.Evaluate(attValue)); } else
1096  if (attName=="rx") { rotation.setX(eval.Evaluate(attValue)); } else
1097  if (attName=="ry") { rotation.setY(eval.Evaluate(attValue)); } else
1098  if (attName=="rz") { rotation.setZ(eval.Evaluate(attValue)); } else
1099  if (attName=="dx") { position.setX(eval.Evaluate(attValue)); } else
1100  if (attName=="dy") { position.setY(eval.Evaluate(attValue)); } else
1101  if (attName=="dz") { position.setZ(eval.Evaluate(attValue)); }
1102  }
1103 
1104  rotation *= aunit;
1105  position *= lunit;
1106 
1107  G4Transform3D transform(GetRotationMatrix(rotation),position);
1108  transform = transform*G4Scale3D(scale.x(),scale.y(),scale.z());
1109 
1110  new G4ReflectedSolid(name,GetSolid(solid),transform);
1111 }
1112 
1114 SectionRead(const xercesc::DOMElement* const sectionElement,G4double lunit)
1115 {
1116  G4double zPosition = 0.0;
1117  G4TwoVector Offset;
1118  G4double scalingFactor = 1.0;
1119 
1120  const xercesc::DOMNamedNodeMap* const attributes
1121  = sectionElement->getAttributes();
1122  XMLSize_t attributeCount = attributes->getLength();
1123 
1124  for (XMLSize_t attribute_index=0;
1125  attribute_index<attributeCount; attribute_index++)
1126  {
1127  xercesc::DOMNode* attribute_node = attributes->item(attribute_index);
1128 
1129  if (attribute_node->getNodeType() != xercesc::DOMNode::ATTRIBUTE_NODE)
1130  { continue; }
1131 
1132  const xercesc::DOMAttr* const attribute
1133  = dynamic_cast<xercesc::DOMAttr*>(attribute_node);
1134  if (!attribute)
1135  {
1136  G4Exception("G4GDMLReadSolids::SectionRead()",
1137  "InvalidRead", FatalException, "No attribute found!");
1138  return G4ExtrudedSolid::ZSection(zPosition,Offset,scalingFactor);
1139  }
1140  const G4String attName = Transcode(attribute->getName());
1141  const G4String attValue = Transcode(attribute->getValue());
1142 
1143  if (attName=="zPosition")
1144  { zPosition = eval.Evaluate(attValue)*lunit; } else
1145  if (attName=="xOffset")
1146  { Offset.setX(eval.Evaluate(attValue)*lunit); } else
1147  if (attName=="yOffset")
1148  { Offset.setY(eval.Evaluate(attValue)*lunit); } else
1149  if (attName=="scalingFactor")
1150  { scalingFactor = eval.Evaluate(attValue); }
1151  }
1152 
1153  return G4ExtrudedSolid::ZSection(zPosition,Offset,scalingFactor);
1154 }
1155 
1156 void G4GDMLReadSolids::
1157 SphereRead(const xercesc::DOMElement* const sphereElement)
1158 {
1159  G4String name;
1160  G4double lunit = 1.0;
1161  G4double aunit = 1.0;
1162  G4double rmin = 0.0;
1163  G4double rmax = 0.0;
1164  G4double startphi = 0.0;
1165  G4double deltaphi = 0.0;
1166  G4double starttheta = 0.0;
1167  G4double deltatheta = 0.0;
1168 
1169  const xercesc::DOMNamedNodeMap* const attributes
1170  = sphereElement->getAttributes();
1171  XMLSize_t attributeCount = attributes->getLength();
1172 
1173  for (XMLSize_t attribute_index=0;
1174  attribute_index<attributeCount; attribute_index++)
1175  {
1176  xercesc::DOMNode* attribute_node = attributes->item(attribute_index);
1177 
1178  if (attribute_node->getNodeType() != xercesc::DOMNode::ATTRIBUTE_NODE)
1179  { continue; }
1180 
1181  const xercesc::DOMAttr* const attribute
1182  = dynamic_cast<xercesc::DOMAttr*>(attribute_node);
1183  if (!attribute)
1184  {
1185  G4Exception("G4GDMLReadSolids::SphereRead()",
1186  "InvalidRead", FatalException, "No attribute found!");
1187  return;
1188  }
1189  const G4String attName = Transcode(attribute->getName());
1190  const G4String attValue = Transcode(attribute->getValue());
1191 
1192  if (attName=="name") { name = GenerateName(attValue); } else
1193  if (attName=="lunit") { lunit = eval.Evaluate(attValue); } else
1194  if (attName=="aunit") { aunit = eval.Evaluate(attValue); } else
1195  if (attName=="rmin") { rmin = eval.Evaluate(attValue); } else
1196  if (attName=="rmax") { rmax = eval.Evaluate(attValue); } else
1197  if (attName=="startphi") { startphi = eval.Evaluate(attValue); } else
1198  if (attName=="deltaphi") { deltaphi = eval.Evaluate(attValue); } else
1199  if (attName=="starttheta") { starttheta = eval.Evaluate(attValue); } else
1200  if (attName=="deltatheta") { deltatheta = eval.Evaluate(attValue); }
1201  }
1202 
1203  rmin *= lunit;
1204  rmax *= lunit;
1205  startphi *= aunit;
1206  deltaphi *= aunit;
1207  starttheta *= aunit;
1208  deltatheta *= aunit;
1209 
1210  new G4Sphere(name,rmin,rmax,startphi,deltaphi,starttheta,deltatheta);
1211 }
1212 
1213 void G4GDMLReadSolids::
1214 TessellatedRead(const xercesc::DOMElement* const tessellatedElement)
1215 {
1216  G4String name;
1217 
1218  const xercesc::DOMNamedNodeMap* const attributes
1219  = tessellatedElement->getAttributes();
1220  XMLSize_t attributeCount = attributes->getLength();
1221 
1222  for (XMLSize_t attribute_index=0;
1223  attribute_index<attributeCount; attribute_index++)
1224  {
1225  xercesc::DOMNode* attribute_node = attributes->item(attribute_index);
1226 
1227  if (attribute_node->getNodeType() != xercesc::DOMNode::ATTRIBUTE_NODE)
1228  { continue; }
1229 
1230  const xercesc::DOMAttr* const attribute
1231  = dynamic_cast<xercesc::DOMAttr*>(attribute_node);
1232  if (!attribute)
1233  {
1234  G4Exception("G4GDMLReadSolids::TessellatedRead()",
1235  "InvalidRead", FatalException, "No attribute found!");
1236  return;
1237  }
1238  const G4String attName = Transcode(attribute->getName());
1239  const G4String attValue = Transcode(attribute->getValue());
1240 
1241  if (attName=="name") { name = GenerateName(attValue); }
1242  }
1243 
1244  G4TessellatedSolid *tessellated = new G4TessellatedSolid(name);
1245 
1246  for (xercesc::DOMNode* iter = tessellatedElement->getFirstChild();
1247  iter != 0; iter = iter->getNextSibling())
1248  {
1249  if (iter->getNodeType() != xercesc::DOMNode::ELEMENT_NODE) { continue; }
1250 
1251  const xercesc::DOMElement* const child
1252  = dynamic_cast<xercesc::DOMElement*>(iter);
1253  if (!child)
1254  {
1255  G4Exception("G4GDMLReadSolids::TessellatedRead()",
1256  "InvalidRead", FatalException, "No child found!");
1257  return;
1258  }
1259  const G4String tag = Transcode(child->getTagName());
1260 
1261  if (tag=="triangular")
1262  { tessellated->AddFacet(TriangularRead(child)); } else
1263  if (tag=="quadrangular")
1264  { tessellated->AddFacet(QuadrangularRead(child)); }
1265  }
1266 
1267  tessellated->SetSolidClosed(true);
1268 }
1269 
1270 void G4GDMLReadSolids::TetRead(const xercesc::DOMElement* const tetElement)
1271 {
1272  G4String name;
1273  G4ThreeVector vertex1;
1274  G4ThreeVector vertex2;
1275  G4ThreeVector vertex3;
1276  G4ThreeVector vertex4;
1277  G4double lunit = 1.0;
1278 
1279  const xercesc::DOMNamedNodeMap* const attributes
1280  = tetElement->getAttributes();
1281  XMLSize_t attributeCount = attributes->getLength();
1282 
1283  for (XMLSize_t attribute_index=0;
1284  attribute_index<attributeCount;attribute_index++)
1285  {
1286  xercesc::DOMNode* attribute_node = attributes->item(attribute_index);
1287 
1288  if (attribute_node->getNodeType() != xercesc::DOMNode::ATTRIBUTE_NODE)
1289  { continue; }
1290 
1291  const xercesc::DOMAttr* const attribute
1292  = dynamic_cast<xercesc::DOMAttr*>(attribute_node);
1293  if (!attribute)
1294  {
1295  G4Exception("G4GDMLReadSolids::TetRead()",
1296  "InvalidRead", FatalException, "No attribute found!");
1297  return;
1298  }
1299  const G4String attName = Transcode(attribute->getName());
1300  const G4String attValue = Transcode(attribute->getValue());
1301 
1302  if (attName=="name")
1303  { name = GenerateName(attValue); } else
1304  if (attName=="lunit")
1305  { lunit = eval.Evaluate(attValue); } else
1306  if (attName=="vertex1")
1307  { vertex1 = GetPosition(GenerateName(attValue)); } else
1308  if (attName=="vertex2")
1309  { vertex2 = GetPosition(GenerateName(attValue)); } else
1310  if (attName=="vertex3")
1311  { vertex3 = GetPosition(GenerateName(attValue)); } else
1312  if (attName=="vertex4")
1313  { vertex4 = GetPosition(GenerateName(attValue)); }
1314  }
1315 
1316  new G4Tet(name,vertex1*lunit,vertex2*lunit,vertex3*lunit,vertex4*lunit);
1317 }
1318 
1319 void G4GDMLReadSolids::TorusRead(const xercesc::DOMElement* const torusElement)
1320 {
1321  G4String name;
1322  G4double lunit = 1.0;
1323  G4double aunit = 1.0;
1324  G4double rmin = 0.0;
1325  G4double rmax = 0.0;
1326  G4double rtor = 0.0;
1327  G4double startphi = 0.0;
1328  G4double deltaphi = 0.0;
1329 
1330  const xercesc::DOMNamedNodeMap* const attributes
1331  = torusElement->getAttributes();
1332  XMLSize_t attributeCount = attributes->getLength();
1333 
1334  for (XMLSize_t attribute_index=0;
1335  attribute_index<attributeCount; attribute_index++)
1336  {
1337  xercesc::DOMNode* attribute_node = attributes->item(attribute_index);
1338 
1339  if (attribute_node->getNodeType() != xercesc::DOMNode::ATTRIBUTE_NODE)
1340  { continue; }
1341 
1342  const xercesc::DOMAttr* const attribute
1343  = dynamic_cast<xercesc::DOMAttr*>(attribute_node);
1344  if (!attribute)
1345  {
1346  G4Exception("G4GDMLReadSolids::TorusRead()",
1347  "InvalidRead", FatalException, "No attribute found!");
1348  return;
1349  }
1350  const G4String attName = Transcode(attribute->getName());
1351  const G4String attValue = Transcode(attribute->getValue());
1352 
1353  if (attName=="name") { name = GenerateName(attValue); } else
1354  if (attName=="lunit") { lunit = eval.Evaluate(attValue); } else
1355  if (attName=="aunit") { aunit = eval.Evaluate(attValue); } else
1356  if (attName=="rmin") { rmin = eval.Evaluate(attValue); } else
1357  if (attName=="rmax") { rmax = eval.Evaluate(attValue); } else
1358  if (attName=="rtor") { rtor = eval.Evaluate(attValue); } else
1359  if (attName=="startphi") { startphi = eval.Evaluate(attValue); } else
1360  if (attName=="deltaphi") { deltaphi = eval.Evaluate(attValue); }
1361  }
1362 
1363  rmin *= lunit;
1364  rmax *= lunit;
1365  rtor *= lunit;
1366  startphi *= aunit;
1367  deltaphi *= aunit;
1368 
1369  new G4Torus(name,rmin,rmax,rtor,startphi,deltaphi);
1370 }
1371 
1372 void G4GDMLReadSolids::
1373 GenTrapRead(const xercesc::DOMElement* const gtrapElement)
1374 {
1375  G4String name;
1376  G4double lunit = 1.0;
1377  G4double dz =0.0;
1378  G4double v1x=0.0, v1y=0.0, v2x=0.0, v2y=0.0, v3x=0.0, v3y=0.0,
1379  v4x=0.0, v4y=0.0, v5x=0.0, v5y=0.0, v6x=0.0, v6y=0.0,
1380  v7x=0.0, v7y=0.0, v8x=0.0, v8y=0.0;
1381 
1382  const xercesc::DOMNamedNodeMap* const attributes
1383  = gtrapElement->getAttributes();
1384  XMLSize_t attributeCount = attributes->getLength();
1385 
1386  for (XMLSize_t attribute_index=0;
1387  attribute_index<attributeCount; attribute_index++)
1388  {
1389  xercesc::DOMNode* attribute_node = attributes->item(attribute_index);
1390 
1391  if (attribute_node->getNodeType() != xercesc::DOMNode::ATTRIBUTE_NODE)
1392  { continue; }
1393 
1394  const xercesc::DOMAttr* const attribute
1395  = dynamic_cast<xercesc::DOMAttr*>(attribute_node);
1396  if (!attribute)
1397  {
1398  G4Exception("G4GDMLReadSolids::GenTrapRead()",
1399  "InvalidRead", FatalException, "No attribute found!");
1400  return;
1401  }
1402  const G4String attName = Transcode(attribute->getName());
1403  const G4String attValue = Transcode(attribute->getValue());
1404 
1405  if (attName=="name") { name = GenerateName(attValue); } else
1406  if (attName=="lunit") { lunit = eval.Evaluate(attValue); } else
1407  if (attName=="dz") { dz = eval.Evaluate(attValue); } else
1408  if (attName=="v1x") { v1x = eval.Evaluate(attValue); } else
1409  if (attName=="v1y") { v1y = eval.Evaluate(attValue); } else
1410  if (attName=="v2x") { v2x = eval.Evaluate(attValue); } else
1411  if (attName=="v2y") { v2y = eval.Evaluate(attValue); } else
1412  if (attName=="v3x") { v3x = eval.Evaluate(attValue); } else
1413  if (attName=="v3y") { v3y = eval.Evaluate(attValue); } else
1414  if (attName=="v4x") { v4x = eval.Evaluate(attValue); } else
1415  if (attName=="v4y") { v4y = eval.Evaluate(attValue); } else
1416  if (attName=="v5x") { v5x = eval.Evaluate(attValue); } else
1417  if (attName=="v5y") { v5y = eval.Evaluate(attValue); } else
1418  if (attName=="v6x") { v6x = eval.Evaluate(attValue); } else
1419  if (attName=="v6y") { v6y = eval.Evaluate(attValue); } else
1420  if (attName=="v7x") { v7x = eval.Evaluate(attValue); } else
1421  if (attName=="v7y") { v7y = eval.Evaluate(attValue); } else
1422  if (attName=="v8x") { v8x = eval.Evaluate(attValue); } else
1423  if (attName=="v8y") { v8y = eval.Evaluate(attValue); }
1424  }
1425 
1426  dz *= lunit;
1427  std::vector<G4TwoVector> vertices;
1428  vertices.push_back(G4TwoVector(v1x*lunit,v1y*lunit));
1429  vertices.push_back(G4TwoVector(v2x*lunit,v2y*lunit));
1430  vertices.push_back(G4TwoVector(v3x*lunit,v3y*lunit));
1431  vertices.push_back(G4TwoVector(v4x*lunit,v4y*lunit));
1432  vertices.push_back(G4TwoVector(v5x*lunit,v5y*lunit));
1433  vertices.push_back(G4TwoVector(v6x*lunit,v6y*lunit));
1434  vertices.push_back(G4TwoVector(v7x*lunit,v7y*lunit));
1435  vertices.push_back(G4TwoVector(v8x*lunit,v8y*lunit));
1436  new G4GenericTrap(name,dz,vertices);
1437 }
1438 
1439 void G4GDMLReadSolids::TrapRead(const xercesc::DOMElement* const trapElement)
1440 {
1441  G4String name;
1442  G4double lunit = 1.0;
1443  G4double aunit = 1.0;
1444  G4double z = 0.0;
1445  G4double theta = 0.0;
1446  G4double phi = 0.0;
1447  G4double y1 = 0.0;
1448  G4double x1 = 0.0;
1449  G4double x2 = 0.0;
1450  G4double alpha1 = 0.0;
1451  G4double y2 = 0.0;
1452  G4double x3 = 0.0;
1453  G4double x4 = 0.0;
1454  G4double alpha2 = 0.0;
1455 
1456  const xercesc::DOMNamedNodeMap* const attributes
1457  = trapElement->getAttributes();
1458  XMLSize_t attributeCount = attributes->getLength();
1459 
1460  for (XMLSize_t attribute_index=0;
1461  attribute_index<attributeCount; attribute_index++)
1462  {
1463  xercesc::DOMNode* attribute_node = attributes->item(attribute_index);
1464 
1465  if (attribute_node->getNodeType() != xercesc::DOMNode::ATTRIBUTE_NODE)
1466  { continue; }
1467 
1468  const xercesc::DOMAttr* const attribute
1469  = dynamic_cast<xercesc::DOMAttr*>(attribute_node);
1470  if (!attribute)
1471  {
1472  G4Exception("G4GDMLReadSolids::TrapRead()",
1473  "InvalidRead", FatalException, "No attribute found!");
1474  return;
1475  }
1476  const G4String attName = Transcode(attribute->getName());
1477  const G4String attValue = Transcode(attribute->getValue());
1478 
1479  if (attName=="name") { name = GenerateName(attValue); } else
1480  if (attName=="lunit") { lunit = eval.Evaluate(attValue); } else
1481  if (attName=="aunit") { aunit = eval.Evaluate(attValue); } else
1482  if (attName=="z") { z = eval.Evaluate(attValue); } else
1483  if (attName=="theta") { theta = eval.Evaluate(attValue); } else
1484  if (attName=="phi") { phi = eval.Evaluate(attValue); } else
1485  if (attName=="y1") { y1 = eval.Evaluate(attValue); } else
1486  if (attName=="x1") { x1 = eval.Evaluate(attValue); } else
1487  if (attName=="x2") { x2 = eval.Evaluate(attValue); } else
1488  if (attName=="alpha1") { alpha1 = eval.Evaluate(attValue); } else
1489  if (attName=="y2") { y2 = eval.Evaluate(attValue); } else
1490  if (attName=="x3") { x3 = eval.Evaluate(attValue); } else
1491  if (attName=="x4") { x4 = eval.Evaluate(attValue); } else
1492  if (attName=="alpha2") { alpha2 = eval.Evaluate(attValue); }
1493  }
1494 
1495  z *= 0.5*lunit;
1496  theta *= aunit;
1497  phi *= aunit;
1498  y1 *= 0.5*lunit;
1499  x1 *= 0.5*lunit;
1500  x2 *= 0.5*lunit;
1501  alpha1 *= aunit;
1502  y2 *= 0.5*lunit;
1503  x3 *= 0.5*lunit;
1504  x4 *= 0.5*lunit;
1505  alpha2 *= aunit;
1506 
1507  new G4Trap(name,z,theta,phi,y1,x1,x2,alpha1,y2,x3,x4,alpha2);
1508 }
1509 
1510 void G4GDMLReadSolids::TrdRead(const xercesc::DOMElement* const trdElement)
1511 {
1512  G4String name;
1513  G4double lunit = 1.0;
1514  G4double x1 = 0.0;
1515  G4double x2 = 0.0;
1516  G4double y1 = 0.0;
1517  G4double y2 = 0.0;
1518  G4double z = 0.0;
1519 
1520  const xercesc::DOMNamedNodeMap* const attributes = trdElement->getAttributes();
1521  XMLSize_t attributeCount = attributes->getLength();
1522 
1523  for (XMLSize_t attribute_index=0;
1524  attribute_index<attributeCount; attribute_index++)
1525  {
1526  xercesc::DOMNode* attribute_node = attributes->item(attribute_index);
1527 
1528  if (attribute_node->getNodeType() != xercesc::DOMNode::ATTRIBUTE_NODE)
1529  { continue; }
1530 
1531  const xercesc::DOMAttr* const attribute
1532  = dynamic_cast<xercesc::DOMAttr*>(attribute_node);
1533  if (!attribute)
1534  {
1535  G4Exception("G4GDMLReadSolids::TrdRead()",
1536  "InvalidRead", FatalException, "No attribute found!");
1537  return;
1538  }
1539  const G4String attName = Transcode(attribute->getName());
1540  const G4String attValue = Transcode(attribute->getValue());
1541 
1542  if (attName=="name") { name = GenerateName(attValue); } else
1543  if (attName=="lunit") { lunit = eval.Evaluate(attValue); } else
1544  if (attName=="x1") { x1 = eval.Evaluate(attValue); } else
1545  if (attName=="x2") { x2 = eval.Evaluate(attValue); } else
1546  if (attName=="y1") { y1 = eval.Evaluate(attValue); } else
1547  if (attName=="y2") { y2 = eval.Evaluate(attValue); } else
1548  if (attName=="z") { z = eval.Evaluate(attValue); }
1549  }
1550 
1551  x1 *= 0.5*lunit;
1552  x2 *= 0.5*lunit;
1553  y1 *= 0.5*lunit;
1554  y2 *= 0.5*lunit;
1555  z *= 0.5*lunit;
1556 
1557  new G4Trd(name,x1,x2,y1,y2,z);
1558 }
1559 
1561 TriangularRead(const xercesc::DOMElement* const triangularElement)
1562 {
1563  G4ThreeVector vertex1;
1564  G4ThreeVector vertex2;
1565  G4ThreeVector vertex3;
1566  G4FacetVertexType type = ABSOLUTE;
1567  G4double lunit = 1.0;
1568 
1569  const xercesc::DOMNamedNodeMap* const attributes
1570  = triangularElement->getAttributes();
1571  XMLSize_t attributeCount = attributes->getLength();
1572 
1573  for (XMLSize_t attribute_index=0;
1574  attribute_index<attributeCount; attribute_index++)
1575  {
1576  xercesc::DOMNode* attribute_node = attributes->item(attribute_index);
1577 
1578  if (attribute_node->getNodeType() != xercesc::DOMNode::ATTRIBUTE_NODE)
1579  { continue; }
1580 
1581  const xercesc::DOMAttr* const attribute
1582  = dynamic_cast<xercesc::DOMAttr*>(attribute_node);
1583  if (!attribute)
1584  {
1585  G4Exception("G4GDMLReadSolids::TriangularRead()",
1586  "InvalidRead", FatalException, "No attribute found!");
1587  return 0;
1588  }
1589  const G4String attName = Transcode(attribute->getName());
1590  const G4String attValue = Transcode(attribute->getValue());
1591 
1592  if (attName=="vertex1")
1593  { vertex1 = GetPosition(GenerateName(attValue)); } else
1594  if (attName=="vertex2")
1595  { vertex2 = GetPosition(GenerateName(attValue)); } else
1596  if (attName=="vertex3")
1597  { vertex3 = GetPosition(GenerateName(attValue)); } else
1598  if (attName=="lunit")
1599  { lunit = eval.Evaluate(attValue); } else
1600  if (attName=="type")
1601  { if (attValue=="RELATIVE") { type = RELATIVE; } }
1602  }
1603 
1604  return new G4TriangularFacet(vertex1*lunit,vertex2*lunit,vertex3*lunit,type);
1605 }
1606 
1607 void G4GDMLReadSolids::TubeRead(const xercesc::DOMElement* const tubeElement)
1608 {
1609  G4String name;
1610  G4double lunit = 1.0;
1611  G4double aunit = 1.0;
1612  G4double rmin = 0.0;
1613  G4double rmax = 0.0;
1614  G4double z = 0.0;
1615  G4double startphi = 0.0;
1616  G4double deltaphi = 0.0;
1617 
1618  const xercesc::DOMNamedNodeMap* const attributes
1619  = tubeElement->getAttributes();
1620  XMLSize_t attributeCount = attributes->getLength();
1621 
1622  for (XMLSize_t attribute_index=0;
1623  attribute_index<attributeCount; attribute_index++)
1624  {
1625  xercesc::DOMNode* attribute_node = attributes->item(attribute_index);
1626 
1627  if (attribute_node->getNodeType() != xercesc::DOMNode::ATTRIBUTE_NODE)
1628  { continue; }
1629 
1630  const xercesc::DOMAttr* const attribute
1631  = dynamic_cast<xercesc::DOMAttr*>(attribute_node);
1632  if (!attribute)
1633  {
1634  G4Exception("G4GDMLReadSolids::TubeRead()",
1635  "InvalidRead", FatalException, "No attribute found!");
1636  return;
1637  }
1638  const G4String attName = Transcode(attribute->getName());
1639  const G4String attValue = Transcode(attribute->getValue());
1640 
1641  if (attName=="name") { name = GenerateName(attValue); } else
1642  if (attName=="lunit") { lunit = eval.Evaluate(attValue); } else
1643  if (attName=="aunit") { aunit = eval.Evaluate(attValue); } else
1644  if (attName=="rmin") { rmin = eval.Evaluate(attValue); } else
1645  if (attName=="rmax") { rmax = eval.Evaluate(attValue); } else
1646  if (attName=="z") { z = eval.Evaluate(attValue); } else
1647  if (attName=="startphi") { startphi = eval.Evaluate(attValue); } else
1648  if (attName=="deltaphi") { deltaphi = eval.Evaluate(attValue); }
1649  }
1650 
1651  rmin *= lunit;
1652  rmax *= lunit;
1653  z *= 0.5*lunit;
1654  startphi *= aunit;
1655  deltaphi *= aunit;
1656 
1657  new G4Tubs(name,rmin,rmax,z,startphi,deltaphi);
1658 }
1659 
1660 void G4GDMLReadSolids::CutTubeRead(const xercesc::DOMElement* const cuttubeElement)
1661 {
1662  G4String name;
1663  G4double lunit = 1.0;
1664  G4double aunit = 1.0;
1665  G4double rmin = 0.0;
1666  G4double rmax = 0.0;
1667  G4double z = 0.0;
1668  G4double startphi = 0.0;
1669  G4double deltaphi = 0.0;
1670  G4ThreeVector lowNorm(0);
1671  G4ThreeVector highNorm(0);
1672 
1673  const xercesc::DOMNamedNodeMap* const attributes
1674  = cuttubeElement->getAttributes();
1675  XMLSize_t attributeCount = attributes->getLength();
1676 
1677  for (XMLSize_t attribute_index=0;
1678  attribute_index<attributeCount; attribute_index++)
1679  {
1680  xercesc::DOMNode* attribute_node = attributes->item(attribute_index);
1681 
1682  if (attribute_node->getNodeType() != xercesc::DOMNode::ATTRIBUTE_NODE)
1683  { continue; }
1684 
1685  const xercesc::DOMAttr* const attribute
1686  = dynamic_cast<xercesc::DOMAttr*>(attribute_node);
1687  if (!attribute)
1688  {
1689  G4Exception("G4GDMLReadSolids::CutTubeRead()",
1690  "InvalidRead", FatalException, "No attribute found!");
1691  return;
1692  }
1693  const G4String attName = Transcode(attribute->getName());
1694  const G4String attValue = Transcode(attribute->getValue());
1695 
1696  if (attName=="name") { name = GenerateName(attValue); } else
1697  if (attName=="lunit") { lunit = eval.Evaluate(attValue); } else
1698  if (attName=="aunit") { aunit = eval.Evaluate(attValue); } else
1699  if (attName=="rmin") { rmin = eval.Evaluate(attValue); } else
1700  if (attName=="rmax") { rmax = eval.Evaluate(attValue); } else
1701  if (attName=="z") { z = eval.Evaluate(attValue); } else
1702  if (attName=="startphi") { startphi = eval.Evaluate(attValue); } else
1703  if (attName=="deltaphi") { deltaphi = eval.Evaluate(attValue); } else
1704  if (attName=="lowX") { lowNorm.setX (eval.Evaluate(attValue)); } else
1705  if (attName=="lowY") { lowNorm.setY (eval.Evaluate(attValue)); } else
1706  if (attName=="lowZ") { lowNorm.setZ (eval.Evaluate(attValue)); } else
1707  if (attName=="highX") { highNorm.setX (eval.Evaluate(attValue)); } else
1708  if (attName=="highY") { highNorm.setY (eval.Evaluate(attValue)); } else
1709  if (attName=="highZ") { highNorm.setZ (eval.Evaluate(attValue)); }
1710 
1711  }
1712 
1713  rmin *= lunit;
1714  rmax *= lunit;
1715  z *= 0.5*lunit;
1716  startphi *= aunit;
1717  deltaphi *= aunit;
1718 
1719  new G4CutTubs(name,rmin,rmax,z,startphi,deltaphi,lowNorm,highNorm);
1720 }
1721 
1722 void G4GDMLReadSolids::
1723 TwistedboxRead(const xercesc::DOMElement* const twistedboxElement)
1724 {
1725  G4String name;
1726  G4double lunit = 1.0;
1727  G4double aunit = 1.0;
1728  G4double PhiTwist = 0.0;
1729  G4double x = 0.0;
1730  G4double y = 0.0;
1731  G4double z = 0.0;
1732 
1733  const xercesc::DOMNamedNodeMap* const attributes
1734  = twistedboxElement->getAttributes();
1735  XMLSize_t attributeCount = attributes->getLength();
1736 
1737  for (XMLSize_t attribute_index=0;
1738  attribute_index<attributeCount; attribute_index++)
1739  {
1740  xercesc::DOMNode* attribute_node = attributes->item(attribute_index);
1741 
1742  if (attribute_node->getNodeType() != xercesc::DOMNode::ATTRIBUTE_NODE)
1743  { continue; }
1744 
1745  const xercesc::DOMAttr* const attribute
1746  = dynamic_cast<xercesc::DOMAttr*>(attribute_node);
1747  if (!attribute)
1748  {
1749  G4Exception("G4GDMLReadSolids::TwistedboxRead()",
1750  "InvalidRead", FatalException, "No attribute found!");
1751  return;
1752  }
1753  const G4String attName = Transcode(attribute->getName());
1754  const G4String attValue = Transcode(attribute->getValue());
1755 
1756  if (attName=="name") { name = GenerateName(attValue); } else
1757  if (attName=="lunit") { lunit = eval.Evaluate(attValue); } else
1758  if (attName=="aunit") { aunit = eval.Evaluate(attValue); } else
1759  if (attName=="PhiTwist") { PhiTwist = eval.Evaluate(attValue); } else
1760  if (attName=="x") { x = eval.Evaluate(attValue); } else
1761  if (attName=="y") { y = eval.Evaluate(attValue); } else
1762  if (attName=="z") { z = eval.Evaluate(attValue); }
1763  }
1764 
1765  PhiTwist *= aunit;
1766  x *= 0.5*lunit;
1767  y *= 0.5*lunit;
1768  z *= 0.5*lunit;
1769 
1770  new G4TwistedBox(name,PhiTwist,x,y,z);
1771 }
1772 
1773 void G4GDMLReadSolids::
1774 TwistedtrapRead(const xercesc::DOMElement* const twistedtrapElement)
1775 {
1776  G4String name;
1777  G4double lunit = 1.0;
1778  G4double aunit = 1.0;
1779  G4double PhiTwist = 0.0;
1780  G4double z = 0.0;
1781  G4double Theta = 0.0;
1782  G4double Phi = 0.0;
1783  G4double y1 = 0.0;
1784  G4double x1 = 0.0;
1785  G4double x2 = 0.0;
1786  G4double y2 = 0.0;
1787  G4double x3 = 0.0;
1788  G4double x4 = 0.0;
1789  G4double Alph = 0.0;
1790 
1791  const xercesc::DOMNamedNodeMap* const attributes
1792  = twistedtrapElement->getAttributes();
1793  XMLSize_t attributeCount = attributes->getLength();
1794 
1795  for (XMLSize_t attribute_index=0;
1796  attribute_index<attributeCount; attribute_index++)
1797  {
1798  xercesc::DOMNode* attribute_node = attributes->item(attribute_index);
1799 
1800  if (attribute_node->getNodeType() != xercesc::DOMNode::ATTRIBUTE_NODE)
1801  { continue; }
1802 
1803  const xercesc::DOMAttr* const attribute
1804  = dynamic_cast<xercesc::DOMAttr*>(attribute_node);
1805  if (!attribute)
1806  {
1807  G4Exception("G4GDMLReadSolids::TwistedtrapRead()",
1808  "InvalidRead", FatalException, "No attribute found!");
1809  return;
1810  }
1811  const G4String attName = Transcode(attribute->getName());
1812  const G4String attValue = Transcode(attribute->getValue());
1813 
1814  if (attName=="name") { name = GenerateName(attValue); } else
1815  if (attName=="lunit") { lunit = eval.Evaluate(attValue); } else
1816  if (attName=="aunit") { aunit = eval.Evaluate(attValue); } else
1817  if (attName=="PhiTwist") { PhiTwist = eval.Evaluate(attValue); } else
1818  if (attName=="z") { z = eval.Evaluate(attValue); } else
1819  if (attName=="Theta") { Theta = eval.Evaluate(attValue); } else
1820  if (attName=="Phi") { Phi = eval.Evaluate(attValue); } else
1821  if (attName=="y1") { y1 = eval.Evaluate(attValue); } else
1822  if (attName=="x1") { x1 = eval.Evaluate(attValue); } else
1823  if (attName=="x2") { x2 = eval.Evaluate(attValue); } else
1824  if (attName=="y2") { y2 = eval.Evaluate(attValue); } else
1825  if (attName=="x3") { x3 = eval.Evaluate(attValue); } else
1826  if (attName=="x4") { x4 = eval.Evaluate(attValue); } else
1827  if (attName=="Alph") { Alph = eval.Evaluate(attValue); }
1828  }
1829 
1830 
1831  PhiTwist *= aunit;
1832  z *= 0.5*lunit;
1833  Theta *= aunit;
1834  Phi *= aunit;
1835  Alph *= aunit;
1836  y1 *= 0.5*lunit;
1837  x1 *= 0.5*lunit;
1838  x2 *= 0.5*lunit;
1839  y2 *= 0.5*lunit;
1840  x3 *= 0.5*lunit;
1841  x4 *= 0.5*lunit;
1842 
1843  new G4TwistedTrap(name,PhiTwist,z,Theta,Phi,y1,x1,x2,y2,x3,x4,Alph);
1844 }
1845 
1846 void G4GDMLReadSolids::
1847 TwistedtrdRead(const xercesc::DOMElement* const twistedtrdElement)
1848 {
1849  G4String name;
1850  G4double lunit = 1.0;
1851  G4double aunit = 1.0;
1852  G4double x1 = 0.0;
1853  G4double x2 = 0.0;
1854  G4double y1 = 0.0;
1855  G4double y2 = 0.0;
1856  G4double z = 0.0;
1857  G4double PhiTwist = 0.0;
1858 
1859  const xercesc::DOMNamedNodeMap* const attributes
1860  = twistedtrdElement->getAttributes();
1861  XMLSize_t attributeCount = attributes->getLength();
1862 
1863  for (XMLSize_t attribute_index=0;
1864  attribute_index<attributeCount; attribute_index++)
1865  {
1866  xercesc::DOMNode* attribute_node = attributes->item(attribute_index);
1867 
1868  if (attribute_node->getNodeType() != xercesc::DOMNode::ATTRIBUTE_NODE)
1869  { continue; }
1870 
1871  const xercesc::DOMAttr* const attribute
1872  = dynamic_cast<xercesc::DOMAttr*>(attribute_node);
1873  if (!attribute)
1874  {
1875  G4Exception("G4GDMLReadSolids::TwistedtrdRead()",
1876  "InvalidRead", FatalException, "No attribute found!");
1877  return;
1878  }
1879  const G4String attName = Transcode(attribute->getName());
1880  const G4String attValue = Transcode(attribute->getValue());
1881 
1882  if (attName=="name") { name = GenerateName(attValue); } else
1883  if (attName=="lunit") { lunit = eval.Evaluate(attValue); } else
1884  if (attName=="aunit") { aunit = eval.Evaluate(attValue); } else
1885  if (attName=="x1") { x1 = eval.Evaluate(attValue); } else
1886  if (attName=="x2") { x2 = eval.Evaluate(attValue); } else
1887  if (attName=="y1") { y1 = eval.Evaluate(attValue); } else
1888  if (attName=="y2") { y2 = eval.Evaluate(attValue); } else
1889  if (attName=="z") { z = eval.Evaluate(attValue); } else
1890  if (attName=="PhiTwist") { PhiTwist = eval.Evaluate(attValue); }
1891  }
1892 
1893  x1 *= 0.5*lunit;
1894  x2 *= 0.5*lunit;
1895  y1 *= 0.5*lunit;
1896  y2 *= 0.5*lunit;
1897  z *= 0.5*lunit;
1898  PhiTwist *= aunit;
1899 
1900  new G4TwistedTrd(name,x1,x2,y1,y2,z,PhiTwist);
1901 }
1902 
1903 void G4GDMLReadSolids::
1904 TwistedtubsRead(const xercesc::DOMElement* const twistedtubsElement)
1905 {
1906  G4String name;
1907  G4double lunit = 1.0;
1908  G4double aunit = 1.0;
1909  G4double twistedangle = 0.0;
1910  G4double endinnerrad = 0.0;
1911  G4double endouterrad = 0.0;
1912  G4double zlen = 0.0;
1913  G4double phi = 0.0;
1914 
1915  const xercesc::DOMNamedNodeMap* const attributes
1916  = twistedtubsElement->getAttributes();
1917  XMLSize_t attributeCount = attributes->getLength();
1918 
1919  for (XMLSize_t attribute_index=0;
1920  attribute_index<attributeCount; attribute_index++)
1921  {
1922  xercesc::DOMNode* attribute_node = attributes->item(attribute_index);
1923 
1924  if (attribute_node->getNodeType() != xercesc::DOMNode::ATTRIBUTE_NODE)
1925  { continue; }
1926 
1927  const xercesc::DOMAttr* const attribute
1928  = dynamic_cast<xercesc::DOMAttr*>(attribute_node);
1929  if (!attribute)
1930  {
1931  G4Exception("G4GDMLReadSolids::TwistedtubsRead()",
1932  "InvalidRead", FatalException, "No attribute found!");
1933  return;
1934  }
1935  const G4String attName = Transcode(attribute->getName());
1936  const G4String attValue = Transcode(attribute->getValue());
1937 
1938  if (attName=="name") { name = GenerateName(attValue); } else
1939  if (attName=="lunit") { lunit = eval.Evaluate(attValue); } else
1940  if (attName=="aunit") { aunit = eval.Evaluate(attValue); } else
1941  if (attName=="twistedangle") { twistedangle=eval.Evaluate(attValue); } else
1942  if (attName=="endinnerrad") { endinnerrad=eval.Evaluate(attValue); } else
1943  if (attName=="endouterrad") { endouterrad=eval.Evaluate(attValue); } else
1944  if (attName=="zlen") { zlen = eval.Evaluate(attValue); } else
1945  if (attName=="phi") { phi = eval.Evaluate(attValue); }
1946  }
1947 
1948  twistedangle *= aunit;
1949  endinnerrad *= lunit;
1950  endouterrad *= lunit;
1951  zlen *= 0.5*lunit;
1952  phi *= aunit;
1953 
1954  new G4TwistedTubs(name,twistedangle,endinnerrad,endouterrad,zlen,phi);
1955 }
1956 
1958 TwoDimVertexRead(const xercesc::DOMElement* const element, G4double lunit)
1959 {
1960  G4TwoVector vec;
1961 
1962  const xercesc::DOMNamedNodeMap* const attributes = element->getAttributes();
1963  XMLSize_t attributeCount = attributes->getLength();
1964 
1965  for (XMLSize_t attribute_index=0;
1966  attribute_index<attributeCount; attribute_index++)
1967  {
1968  xercesc::DOMNode* attribute_node = attributes->item(attribute_index);
1969 
1970  if (attribute_node->getNodeType() != xercesc::DOMNode::ATTRIBUTE_NODE)
1971  { continue; }
1972 
1973  const xercesc::DOMAttr* const attribute
1974  = dynamic_cast<xercesc::DOMAttr*>(attribute_node);
1975  if (!attribute)
1976  {
1977  G4Exception("G4GDMLReadSolids::TwoDimVertexRead()",
1978  "InvalidRead", FatalException, "No attribute found!");
1979  return vec;
1980  }
1981  const G4String attName = Transcode(attribute->getName());
1982  const G4String attValue = Transcode(attribute->getValue());
1983 
1984  if (attName=="x") { vec.setX(eval.Evaluate(attValue)*lunit); } else
1985  if (attName=="y") { vec.setY(eval.Evaluate(attValue)*lunit); }
1986  }
1987 
1988  return vec;
1989 }
1990 
1992 ZplaneRead(const xercesc::DOMElement* const zplaneElement)
1993 {
1994  zplaneType zplane = {0.,0.,0.};
1995 
1996  const xercesc::DOMNamedNodeMap* const attributes
1997  = zplaneElement->getAttributes();
1998  XMLSize_t attributeCount = attributes->getLength();
1999 
2000  for (XMLSize_t attribute_index=0;
2001  attribute_index<attributeCount; attribute_index++)
2002  {
2003  xercesc::DOMNode* node = attributes->item(attribute_index);
2004 
2005  if (node->getNodeType() != xercesc::DOMNode::ATTRIBUTE_NODE) { continue; }
2006 
2007  const xercesc::DOMAttr* const attribute
2008  = dynamic_cast<xercesc::DOMAttr*>(node);
2009  if (!attribute)
2010  {
2011  G4Exception("G4GDMLReadSolids::ZplaneRead()",
2012  "InvalidRead", FatalException, "No attribute found!");
2013  return zplane;
2014  }
2015  const G4String attName = Transcode(attribute->getName());
2016  const G4String attValue = Transcode(attribute->getValue());
2017 
2018  if (attName=="rmin") { zplane.rmin = eval.Evaluate(attValue); } else
2019  if (attName=="rmax") { zplane.rmax = eval.Evaluate(attValue); } else
2020  if (attName=="z") { zplane.z = eval.Evaluate(attValue); }
2021  }
2022 
2023  return zplane;
2024 }
2025 G4GDMLReadSolids::rzPointType G4GDMLReadSolids::
2026 RZPointRead(const xercesc::DOMElement* const zplaneElement)
2027 {
2028  rzPointType rzpoint = {0.,0.};
2029 
2030  const xercesc::DOMNamedNodeMap* const attributes
2031  = zplaneElement->getAttributes();
2032  XMLSize_t attributeCount = attributes->getLength();
2033 
2034  for (XMLSize_t attribute_index=0;
2035  attribute_index<attributeCount; attribute_index++)
2036  {
2037  xercesc::DOMNode* node = attributes->item(attribute_index);
2038 
2039  if (node->getNodeType() != xercesc::DOMNode::ATTRIBUTE_NODE) { continue; }
2040 
2041  const xercesc::DOMAttr* const attribute
2042  = dynamic_cast<xercesc::DOMAttr*>(node);
2043  if (!attribute)
2044  {
2045  G4Exception("G4GDMLReadSolids::RZPointRead()",
2046  "InvalidRead", FatalException, "No attribute found!");
2047  return rzpoint;
2048  }
2049  const G4String attName = Transcode(attribute->getName());
2050  const G4String attValue = Transcode(attribute->getValue());
2051 
2052  if (attName=="r") { rzpoint.r = eval.Evaluate(attValue); } else
2053  if (attName=="z") { rzpoint.z = eval.Evaluate(attValue); }
2054  }
2055 
2056  return rzpoint;
2057 
2058 }
2059 
2060 void G4GDMLReadSolids::
2061 OpticalSurfaceRead(const xercesc::DOMElement* const opticalsurfaceElement)
2062 {
2063  G4String name;
2064  G4String smodel;
2065  G4String sfinish;
2066  G4String stype;
2067  G4double value = 0.0;
2068 
2069  const xercesc::DOMNamedNodeMap* const attributes
2070  = opticalsurfaceElement->getAttributes();
2071  XMLSize_t attributeCount = attributes->getLength();
2072 
2073  for (XMLSize_t attribute_index=0;
2074  attribute_index<attributeCount; attribute_index++)
2075  {
2076  xercesc::DOMNode* attribute_node = attributes->item(attribute_index);
2077 
2078  if (attribute_node->getNodeType() != xercesc::DOMNode::ATTRIBUTE_NODE)
2079  { continue; }
2080 
2081  const xercesc::DOMAttr* const attribute
2082  = dynamic_cast<xercesc::DOMAttr*>(attribute_node);
2083  if (!attribute)
2084  {
2085  G4Exception("G4GDMLReadSolids::OpticalSurfaceRead()",
2086  "InvalidRead", FatalException, "No attribute found!");
2087  return;
2088  }
2089  const G4String attName = Transcode(attribute->getName());
2090  const G4String attValue = Transcode(attribute->getValue());
2091 
2092  if (attName=="name") { name = GenerateName(attValue); } else
2093  if (attName=="model") { smodel = attValue; } else
2094  if (attName=="finish") { sfinish = attValue; } else
2095  if (attName=="type") { stype = attValue; } else
2096  if (attName=="value") { value = eval.Evaluate(attValue); }
2097  }
2098 
2100  G4OpticalSurfaceFinish finish;
2101  G4SurfaceType type;
2102 
2103  if ((smodel=="glisur") || (smodel=="0")) { model = glisur; } else
2104  if ((smodel=="unified") || (smodel=="1")) { model = unified; }
2105  else { model = LUT; }
2106 
2107  if ((sfinish=="polished") || (sfinish=="0"))
2108  { finish = polished; } else
2109  if ((sfinish=="polishedfrontpainted") || (sfinish=="1"))
2110  { finish = polishedfrontpainted; } else
2111  if ((sfinish=="polishedbackpainted") || (sfinish=="2"))
2112  { finish = polishedbackpainted; } else
2113  if ((sfinish=="ground") || (sfinish=="3"))
2114  { finish = ground; } else
2115  if ((sfinish=="groundfrontpainted") || (sfinish=="4"))
2116  { finish = groundfrontpainted; } else
2117  if ((sfinish=="groundbackpainted") || (sfinish=="5"))
2118  { finish = groundbackpainted; } else
2119  if ((sfinish=="polishedlumirrorair") || (sfinish=="6"))
2120  { finish = polishedlumirrorair; } else
2121  if ((sfinish=="polishedlumirrorglue") || (sfinish=="7"))
2122  { finish = polishedlumirrorglue; } else
2123  if ((sfinish=="polishedair") || (sfinish=="8"))
2124  { finish = polishedair; } else
2125  if ((sfinish=="polishedteflonair") || (sfinish=="9"))
2126  { finish = polishedteflonair; } else
2127  if ((sfinish=="polishedtioair") || (sfinish=="10"))
2128  { finish = polishedtioair; } else
2129  if ((sfinish=="polishedtyvekair") || (sfinish=="11"))
2130  { finish = polishedtyvekair; } else
2131  if ((sfinish=="polishedvm2000air") || (sfinish=="12"))
2132  { finish = polishedvm2000air; } else
2133  if ((sfinish=="polishedvm2000glue") || (sfinish=="13"))
2134  { finish = polishedvm2000glue; } else
2135  if ((sfinish=="etchedlumirrorair") || (sfinish=="14"))
2136  { finish = etchedlumirrorair; } else
2137  if ((sfinish=="etchedlumirrorglue") || (sfinish=="15"))
2138  { finish = etchedlumirrorglue; } else
2139  if ((sfinish=="etchedair") || (sfinish=="16"))
2140  { finish = etchedair; } else
2141  if ((sfinish=="etchedteflonair") || (sfinish=="17"))
2142  { finish = etchedteflonair; } else
2143  if ((sfinish=="etchedtioair") || (sfinish=="18"))
2144  { finish = etchedtioair; } else
2145  if ((sfinish=="etchedtyvekair") || (sfinish=="19"))
2146  { finish = etchedtyvekair; } else
2147  if ((sfinish=="etchedvm2000air") || (sfinish=="20"))
2148  { finish = etchedvm2000air; } else
2149  if ((sfinish=="etchedvm2000glue") || (sfinish=="21"))
2150  { finish = etchedvm2000glue; } else
2151  if ((sfinish=="groundlumirrorair") || (sfinish=="22"))
2152  { finish = groundlumirrorair; } else
2153  if ((sfinish=="groundlumirrorglue") || (sfinish=="23"))
2154  { finish = groundlumirrorglue; } else
2155  if ((sfinish=="groundair") || (sfinish=="24"))
2156  { finish = groundair; } else
2157  if ((sfinish=="groundteflonair") || (sfinish=="25"))
2158  { finish = groundteflonair; } else
2159  if ((sfinish=="groundtioair") || (sfinish=="26"))
2160  { finish = groundtioair; } else
2161  if ((sfinish=="groundtyvekair") || (sfinish=="27"))
2162  { finish = groundtyvekair; } else
2163  if ((sfinish=="groundvm2000air") || (sfinish=="28"))
2164  { finish = groundvm2000air; }
2165  else { finish = groundvm2000glue; }
2166 
2167  if ((stype=="dielectric_metal") || (stype=="0"))
2168  { type = dielectric_metal; } else
2169  if ((stype=="dielectric_dielectric") || (stype=="1"))
2170  { type = dielectric_dielectric; } else
2171  if ((stype=="dielectric_LUT") || (stype=="2"))
2172  { type = dielectric_LUT; } else
2173  if ((stype=="firsov") || (stype=="3"))
2174  { type = firsov; }
2175  else { type = x_ray; }
2176 
2177  new G4OpticalSurface(name,model,finish,type,value);
2178 }
2179 
2180 void G4GDMLReadSolids::SolidsRead(const xercesc::DOMElement* const solidsElement)
2181 {
2182  G4cout << "G4GDML: Reading solids..." << G4endl;
2183 
2184  for (xercesc::DOMNode* iter = solidsElement->getFirstChild();
2185  iter != 0; iter = iter->getNextSibling())
2186  {
2187  if (iter->getNodeType() != xercesc::DOMNode::ELEMENT_NODE) { continue; }
2188 
2189  const xercesc::DOMElement* const child
2190  = dynamic_cast<xercesc::DOMElement*>(iter);
2191  if (!child)
2192  {
2193  G4Exception("G4GDMLReadSolids::SolidsRead()",
2194  "InvalidRead", FatalException, "No child found!");
2195  return;
2196  }
2197  const G4String tag = Transcode(child->getTagName());
2198  if (tag=="define") { DefineRead(child); } else
2199  if (tag=="box") { BoxRead(child); } else
2200  if (tag=="cone") { ConeRead(child); } else
2201  if (tag=="elcone") { ElconeRead(child); } else
2202  if (tag=="ellipsoid") { EllipsoidRead(child); }else
2203  if (tag=="eltube") { EltubeRead(child); } else
2204  if (tag=="xtru") { XtruRead(child); } else
2205  if (tag=="hype") { HypeRead(child); } else
2206  if (tag=="intersection") { BooleanRead(child,INTERSECTION); } else
2207  if (tag=="multiunion") { MultiUnionRead(child); } else
2208  if (tag=="orb") { OrbRead(child); } else
2209  if (tag=="para") { ParaRead(child); } else
2210  if (tag=="paraboloid") { ParaboloidRead(child); } else
2211  if (tag=="polycone") { PolyconeRead(child); } else
2212  if (tag=="genericPolycone") { GenericPolyconeRead(child); } else
2213  if (tag=="polyhedra") { PolyhedraRead(child); } else
2214  if (tag=="genericPolyhedra") { GenericPolyhedraRead(child); } else
2215  if (tag=="reflectedSolid") { ReflectedSolidRead(child); } else
2216  if (tag=="sphere") { SphereRead(child); } else
2217  if (tag=="subtraction") { BooleanRead(child,SUBTRACTION); } else
2218  if (tag=="tessellated") { TessellatedRead(child); } else
2219  if (tag=="tet") { TetRead(child); } else
2220  if (tag=="torus") { TorusRead(child); } else
2221  if (tag=="arb8") { GenTrapRead(child); } else
2222  if (tag=="trap") { TrapRead(child); } else
2223  if (tag=="trd") { TrdRead(child); } else
2224  if (tag=="tube") { TubeRead(child); } else
2225  if (tag=="cutTube") { CutTubeRead(child); } else
2226  if (tag=="twistedbox") { TwistedboxRead(child); } else
2227  if (tag=="twistedtrap") { TwistedtrapRead(child); } else
2228  if (tag=="twistedtrd") { TwistedtrdRead(child); } else
2229  if (tag=="twistedtubs") { TwistedtubsRead(child); } else
2230  if (tag=="union") { BooleanRead(child,UNION); } else
2231  if (tag=="opticalsurface") { OpticalSurfaceRead(child); } else
2232  if (tag=="loop") { LoopRead(child,&G4GDMLRead::SolidsRead); }
2233  else
2234  {
2235  G4String error_msg = "Unknown tag in solids: " + tag;
2236  G4Exception("G4GDMLReadSolids::SolidsRead()", "ReadError",
2237  FatalException, error_msg);
2238  }
2239  }
2240 }
2241 
2243 {
2244  G4VSolid* solidPtr = G4SolidStore::GetInstance()->GetSolid(ref,false);
2245 
2246  if (!solidPtr)
2247  {
2248  G4String error_msg = "Referenced solid '" + ref + "' was not found!";
2249  G4Exception("G4GDMLReadSolids::GetSolid()", "ReadError",
2250  FatalException, error_msg);
2251  }
2252 
2253  return solidPtr;
2254 }
2255 
2257 GetSurfaceProperty(const G4String& ref) const
2258 {
2259  const G4SurfacePropertyTable* surfaceList
2261  const size_t surfaceCount = surfaceList->size();
2262 
2263  for (size_t i=0; i<surfaceCount; i++)
2264  {
2265  if ((*surfaceList)[i]->GetName() == ref) { return (*surfaceList)[i]; }
2266  }
2267 
2268  G4String error_msg = "Referenced optical surface '" + ref + "' was not found!";
2269  G4Exception("G4GDMLReadSolids::GetSurfaceProperty()", "ReadError",
2270  FatalException, error_msg);
2271 
2272  return 0;
2273 }
zplaneType ZplaneRead(const xercesc::DOMElement *const)
void TubeRead(const xercesc::DOMElement *const)
Double_t y2[nxs]
Definition: Style.C:21
void TwistedtrapRead(const xercesc::DOMElement *const)
G4int EvaluateInteger(const G4String &)
Definition: G4Para.hh:76
void SetSolidClosed(const G4bool t)
void BoxRead(const xercesc::DOMElement *const)
G4VSolid * GetSolid(const G4String &name, G4bool verbose=true) const
Double_t y1[nxs]
Definition: Style.C:20
G4GDMLEvaluator eval
Definition: G4GDMLRead.hh:144
Double_t x2[nxs]
Definition: Style.C:19
void OpticalSurfaceRead(const xercesc::DOMElement *const)
double x() const
virtual void DefineRead(const xercesc::DOMElement *const)
Definition: G4Box.hh:63
void TwistedboxRead(const xercesc::DOMElement *const)
Definition: G4Tubs.hh:84
Definition: xmlparse.cc:179
void MultiUnionRead(const xercesc::DOMElement *const)
void TorusRead(const xercesc::DOMElement *const)
G4String Transcode(const XMLCh *const)
Definition: G4GDMLRead.cc:55
void TetRead(const xercesc::DOMElement *const)
const XML_Char * name
Definition: expat.h:151
G4TwoVector TwoDimVertexRead(const xercesc::DOMElement *const, G4double)
G4SurfaceProperty * GetSurfaceProperty(const G4String &) const
void GenericPolyhedraRead(const xercesc::DOMElement *const)
tuple x
Definition: test.py:50
Definition: G4Trd.hh:71
G4SurfaceType
G4TriangularFacet * TriangularRead(const xercesc::DOMElement *const)
int G4int
Definition: G4Types.hh:78
void setY(double)
double z() const
void setZ(double)
void setX(double)
G4VSolid * GetSolid(const G4String &) const
void TwistedtubsRead(const xercesc::DOMElement *const)
void TrapRead(const xercesc::DOMElement *const)
void ConeRead(const xercesc::DOMElement *const)
Double_t y
Definition: plot.C:279
G4String RefRead(const xercesc::DOMElement *const)
void LoopRead(const xercesc::DOMElement *const, void(G4GDMLRead::*)(const xercesc::DOMElement *const))
Definition: G4GDMLRead.cc:179
void SphereRead(const xercesc::DOMElement *const)
void OrbRead(const xercesc::DOMElement *const)
G4ExtrudedSolid::ZSection SectionRead(const xercesc::DOMElement *const, G4double)
G4GLOB_DLL std::ostream G4cout
void BooleanRead(const xercesc::DOMElement *const, const BooleanOp)
G4FacetVertexType
Definition: G4VFacet.hh:56
Definition: G4Tet.hh:65
Definition: G4Hype.hh:66
void ReflectedSolidRead(const xercesc::DOMElement *const)
void EllipsoidRead(const xercesc::DOMElement *const)
Definition: G4Cons.hh:82
G4bool AddFacet(G4VFacet *aFacet)
Double_t x1[nxs]
Definition: Style.C:18
void GenTrapRead(const xercesc::DOMElement *const)
static G4SolidStore * GetInstance()
void TrdRead(const xercesc::DOMElement *const)
const XML_Char XML_Content * model
Definition: expat.h:151
virtual ~G4GDMLReadSolids()
HepGeom::Scale3D G4Scale3D
Double_t scale
Definition: plot.C:11
Definition: G4Orb.hh:60
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *comments)
Definition: G4Exception.cc:41
virtual void SolidsRead(const xercesc::DOMElement *const)
void EltubeRead(const xercesc::DOMElement *const)
rzPointType RZPointRead(const xercesc::DOMElement *const)
jump r
Definition: plot.C:36
std::vector< G4SurfaceProperty * > G4SurfacePropertyTable
G4String GenerateName(const G4String &name, G4bool strip=false)
Definition: G4GDMLRead.cc:68
void TessellatedRead(const xercesc::DOMElement *const)
void PolyhedraRead(const xercesc::DOMElement *const)
void XtruRead(const xercesc::DOMElement *const)
void CutTubeRead(const xercesc::DOMElement *const)
G4OpticalSurfaceFinish
int position
Definition: filter.cc:7
G4int first
double y() const
void VectorRead(const xercesc::DOMElement *const, G4ThreeVector &)
void ParaboloidRead(const xercesc::DOMElement *const)
tuple z
Definition: test.py:28
CLHEP::Hep2Vector G4TwoVector
Definition: G4TwoVector.hh:42
void GenericPolyconeRead(const xercesc::DOMElement *const)
const XML_Char int const XML_Char * value
Definition: expat.h:331
G4OpticalSurfaceModel
void ElconeRead(const xercesc::DOMElement *const)
#define G4endl
Definition: G4ios.hh:61
G4ThreeVector GetRotation(const G4String &)
G4RotationMatrix GetRotationMatrix(const G4ThreeVector &)
void ParaRead(const xercesc::DOMElement *const)
double G4double
Definition: G4Types.hh:76
void HypeRead(const xercesc::DOMElement *const)
void setY(double y)
void PolyconeRead(const xercesc::DOMElement *const)
G4QuadrangularFacet * QuadrangularRead(const xercesc::DOMElement *const)
static const G4SurfacePropertyTable * GetSurfacePropertyTable()
virtual void SolidsRead(const xercesc::DOMElement *const)=0
void TwistedtrdRead(const xercesc::DOMElement *const)
G4double Evaluate(const G4String &)
G4ThreeVector GetPosition(const G4String &)
void setX(double x)