Commit in GeomConverter/src/org/lcsim/geometry/subdetector on MAIN
TPC.java+28-21.1 -> 1.2
Added HepRep conversion function.

GeomConverter/src/org/lcsim/geometry/subdetector
TPC.java 1.1 -> 1.2
diff -u -r1.1 -r1.2
--- TPC.java	20 Aug 2005 19:56:00 -0000	1.1
+++ TPC.java	21 Aug 2005 06:10:43 -0000	1.2
@@ -9,13 +9,19 @@
 import org.jdom.JDOMException;
 import org.jdom.Element;
 import org.lcsim.geometry.CylindricalSubdetector;
+import hep.graphics.heprep.HepRep;
+import hep.graphics.heprep.HepRepFactory;
+import hep.graphics.heprep.HepRepInstance;
+import hep.graphics.heprep.HepRepInstanceTree;
+import hep.graphics.heprep.HepRepType;
+import hep.graphics.heprep.HepRepTypeTree;
 
 /**
  *
  * @author jeremym
  */
-public class TPC extends CylindricalTracker 
-{    
+public class TPC extends CylindricalTracker
+{
     /** Creates a new instance of TPC */
     public TPC(Element node) throws JDOMException
     {
@@ -26,4 +32,24 @@
     {
         return true;
     }
+    
+    public void appendHepRep(HepRepFactory factory, HepRep heprep)
+    {
+        HepRepInstanceTree instanceTree = heprep.getInstanceTreeTop("Detector","1.0");
+        HepRepTypeTree typeTree = heprep.getTypeTree("DetectorType","1.0");
+        HepRepType barrel = typeTree.getType("Barrel");
+        
+        HepRepType type = factory.createHepRepType(barrel, getName());
+        type.addAttValue("drawAs","Cylinder");
+        
+        HepRepInstance instance = factory.createHepRepInstance(instanceTree, type);
+        instance.addAttValue("radius",getInnerRadius());
+        factory.createHepRepPoint(instance,0,0,getZMin());
+        factory.createHepRepPoint(instance,0,0,getZMax());
+        
+        HepRepInstance instance2 = factory.createHepRepInstance(instanceTree, type);
+        instance2.addAttValue("radius",getOuterRadius());
+        factory.createHepRepPoint(instance2,0,0,getZMin());
+        factory.createHepRepPoint(instance2,0,0,getZMax());
+    }
 }
\ No newline at end of file
CVSspam 0.2.8