Commit in GeomConverter/src/org/lcsim/geometry/compact/converter/lcdd on MAIN
LCDDDetector.java+20-131.11 -> 1.12
Moved material code to setupMaterials() method.

GeomConverter/src/org/lcsim/geometry/compact/converter/lcdd
LCDDDetector.java 1.11 -> 1.12
diff -u -r1.11 -r1.12
--- LCDDDetector.java	11 Jun 2005 01:17:53 -0000	1.11
+++ LCDDDetector.java	1 Jul 2005 00:15:30 -0000	1.12
@@ -82,20 +82,10 @@
         for (org.lcsim.geometry.compact.Constant c : getConstants().values())
         {
             define.addConstant(new Constant(c.getName(),String.valueOf(c.getValue())));
-        }
-        
-        /* /\/\/\/\/\/\ MATERIALS /\/\/\/\/\/\ */
-        Element materials = lccdd.getChild("materials");
-             
-        /** Clone materials root from LCCD document into the manager. */
-        XMLMaterialManager mgr = getMaterialManager();        
-        mgr.setMaterialsRoot(materials);                
+        }                
         
-        /** Add materials plus their references from the compact into the manager. */
-        mgr.addReferencesFromCompact(lccdd);                
-        
-        /** Copy only used materials and elements into the LCDD object. */
-        mgr.copyToLCDD(lcdd);
+        /* Setup materials. */
+        setupMaterials(lcdd);
         
         // Loop over the readouts
         Map<Readout,IDSpec> idMap = new HashMap<Readout,IDSpec>();
@@ -172,6 +162,23 @@
         doc.setRootElement(lcdd);
         return doc;
     }
+    
+    private void setupMaterials(LCDD lcdd) throws JDOMException
+    {  
+        /** Get materials root element. */
+        Element materials = lccdd.getChild("materials");
+             
+        /** Clone materials root from LCCD document to the manager. */
+        XMLMaterialManager mgr = getMaterialManager();   
+        mgr.setMaterialsRoot(materials);                
+        
+        /** Add materials plus their references from the compact into the manager. */
+        mgr.addReferencesFromCompact(lccdd);
+        
+        /** Copy only used materials and elements into the LCDD object. */
+        mgr.copyToLCDD(lcdd);
+    }
+    
     private String getName()
     {
         return "GeomConverter";
CVSspam 0.2.8