View Javadoc

1   /*
2    * SubtractionSolid.java
3    *
4    * Created on June 16, 2005, 4:37 PM
5    */
6   
7   package org.lcsim.geometry.compact.converter.lcdd.util;
8   
9   import org.jdom.Element;
10  
11  /**
12   *
13   * @author jeremym
14   */
15  public class BooleanSolid extends Solid
16  {
17      
18      /** Creates a new instance of SubtractionSolid */
19      BooleanSolid(String type, String name)
20      {
21          super(type, name);
22                  
23          Element first = new Element("first");
24          Element second = new Element("second");
25          Element positionref = new Element("positionref");
26          Element rotationref = new Element("rotationref");
27          
28          addContent(first);
29          addContent(second);
30          addContent(positionref);
31          addContent(rotationref);
32      }
33      
34      public void setFirstSolid(Solid s)
35      {
36          getChild("first").setAttribute("ref", s.getRefName() );
37      }
38      
39      public void setSecondSolid(Solid s)
40      {
41          getChild("second").setAttribute("ref", s.getRefName() );
42      }
43      
44      public void setPosition(Position p)
45      {
46          getChild("positionref").setAttribute("ref", p.getRefName() );
47      }
48      
49      public void setRotation(Rotation r)
50      {
51          getChild("rotationref").setAttribute("ref", r.getRefName() );
52      }
53  }