View Javadoc

1   package org.lcsim.geometry.compact.converter.lcdd.util;
2   
3   /**
4    * @author jeremym
5    */
6   public class Trapezoid extends Solid
7   {
8       public Trapezoid(String name, double x1, double x2, double y1, double y2, double z)
9       {
10          super("trd",name);
11          setX1(x1);
12          setX2(x2);
13          setY1(y1);
14          setY2(y2);
15          setZ(z);
16      }
17  
18      public Trapezoid(String name)
19      {
20          super("trd",name);
21      }
22  
23      public double x1()
24      {
25          return getDim("x1")/2;
26      }
27  
28      public double x2()
29      {
30          return getDim("x2")/2;
31      }
32  
33      public double y1()
34      {
35          return getDim("y1")/2;
36      }
37  
38      public double y2()
39      {
40          return getDim("y2")/2;
41      }
42  
43      public double z()
44      {
45          return getDim("z")/2;
46      }
47  
48      // FIXME: Input is multiplied by 2 to conform to GDML "convention" of using full side lengths rather than
49      //        half, which is the Geant4 standard.
50      public void setX1(double x1)
51      {
52          setAttribute("x1",String.valueOf(x1*2));
53      }
54  
55      public void setX2(double x2)
56      {
57          setAttribute("x2", String.valueOf(x2*2));
58      }
59  
60      public void setY1(double y1)
61      {
62          setAttribute("y1", String.valueOf(y1*2));
63      }
64  
65      public void setY2(double y2)
66      {
67          setAttribute("y2", String.valueOf(y2*2));
68      }
69  
70      public void setZ(double z)
71      {
72          setAttribute("z",String.valueOf(z*2));
73      }
74  }