Commit in GeomConverter/src/org/lcsim/material on MAIN
XMLMaterialManager.java+12-111.22 -> 1.23


GeomConverter/src/org/lcsim/material
XMLMaterialManager.java 1.22 -> 1.23
diff -u -r1.22 -r1.23
--- XMLMaterialManager.java	12 Mar 2011 00:37:28 -0000	1.22
+++ XMLMaterialManager.java	21 Apr 2011 19:42:37 -0000	1.23
@@ -21,7 +21,7 @@
  * term "node" to refer to an XML element.
  * 
  * @author jeremym
- * @version $Id: XMLMaterialManager.java,v 1.22 2011/03/12 00:37:28 jeremy Exp $
+ * @version $Id: XMLMaterialManager.java,v 1.23 2011/04/21 19:42:37 jeremy Exp $
  */
 // TODO Refactor spaghetti/recursion code that does reference resolution.
 // TODO Replace parent/child structure of managers with a single manager or utility class.
@@ -67,9 +67,7 @@
      * This method must be called before the XMLMaterialManager is created for a compact document.
      */    
     public static void setup()
-    {
-        //System.out.println("XMLMatMgr.setup()");
-        
+    {        
         // Clear the global material store.
         MaterialManager.instance().clear();
         mgr = MaterialManager.instance();
@@ -176,7 +174,6 @@
         {
             if (hasParentManager())
             {
-                // System.out.println("par lkp");
                 m = parent.getMaterialXML(matName);
             }
         }
@@ -522,17 +519,15 @@
      * @param matNode The XML Element pointing to a material node.
      */
     private void makeMaterialFromXML(Element matNode)
-    {        
-        //System.out.println("makeMaterialFromXML - " + matNode.getAttributeValue("name"));
-        
+    {                
         // Get the name of the material.
         String name = matNode.getAttributeValue("name");
                                         
         // Check if material with this name already exists.
         if (mgr.getMaterial(name) != null)
         {                       
-            // This could be okay, e.g. if a material was moved from a compact description into the default material resource file.
-            // Print a warning in case something strange is happening.
+            // This could be okay, e.g. if a material was moved into default material file
+            // and not removed from compact file.  Print a warning in case something strange is happening.
             System.out.println("WARNING: Ignoring attempt to add material " + name + " that already exists!");
             return;
             //throw new RuntimeException("Attempting to add material " + name + " that already exists!");
@@ -629,5 +624,11 @@
         {
             throw new RuntimeException("Missing at least one fraction or composite element in material " + name + ".");
         }
-    }      
+    }    
+
+    // !!!!!!!!!!!
+    public void clearMaterialMap()
+    {
+        this.materialMap.clear();
+    }
 }
\ No newline at end of file
CVSspam 0.2.8