Print

Print


Commit in GeomConverter/src/org/lcsim/geometry/compact/converter/lcdd/util on MAIN
Define.java+15-41.2 -> 1.3
Rotation.java+141.3 -> 1.4
+29-4
2 modified files


GeomConverter/src/org/lcsim/geometry/compact/converter/lcdd/util
Define.java 1.2 -> 1.3
diff -u -r1.2 -r1.3
--- Define.java	30 Jun 2005 00:36:10 -0000	1.2
+++ Define.java	13 Apr 2011 00:09:52 -0000	1.3
@@ -5,7 +5,7 @@
 import org.jdom.Element;
 
 /**
- *
+ * 
  * @author tonyj
  */
 public class Define extends Element
@@ -13,29 +13,40 @@
     private Map rotations = new HashMap();
     private Map constants = new HashMap();
     private Map positions = new HashMap();
+
     public Define()
     {
         super("define");
     }
+
     public void addConstant(Constant constant)
     {
         addContent(constant);
-        constants.put(constant.getRefName(),constant);
+        constants.put(constant.getRefName(), constant);
     }
+
     public void addPosition(Position position)
     {
         addContent(position);
-        positions.put(position.getRefName(),position);
+        positions.put(position.getRefName(), position);
     }
+
     public void addRotation(Rotation rotation)
     {
         addContent(rotation);
-        rotations.put(rotation.getRefName(),rotation);
+        rotations.put(rotation.getRefName(), rotation);
     }
+
     public Rotation getRotation(String name)
     {
         return (Rotation) rotations.get(name);
     }
+
+    public Position getPosition(String name)
+    {
+        return (Position) positions.get(name);
+    }
+
     public Constant getConstant(String name)
     {
         return (Constant) constants.get(name);

GeomConverter/src/org/lcsim/geometry/compact/converter/lcdd/util
Rotation.java 1.3 -> 1.4
diff -u -r1.3 -r1.4
--- Rotation.java	30 Oct 2007 18:29:29 -0000	1.3
+++ Rotation.java	13 Apr 2011 00:09:52 -0000	1.4
@@ -23,6 +23,20 @@
       setAttribute("y","0.0");
       setAttribute("z","0.0");
       setAttribute("unit","radian");
+   }
+   
+   /** 
+    * Creates an identity rotation called <code>name</code> with given
+    * rotations about the X, Y, and Z axes.
+    * @param name The unique name of this rotation. 
+    */
+   public Rotation(String name, double rx, double ry, double rz)
+   {
+      super("rotation",name);
+      setAttribute("x",Double.toString(rx));
+      setAttribute("y",Double.toString(ry));
+      setAttribute("z",Double.toString(rz));
+      setAttribute("unit","radian");
    } 
    
    /**
CVSspam 0.2.8