Commit in GeomConverter/src/org/lcsim/geometry/compact on MAIN
Subdetector.java+13-31.24 -> 1.25
make Subdetector return a default VisAttributes if null when getVisAttributes() is called

GeomConverter/src/org/lcsim/geometry/compact
Subdetector.java 1.24 -> 1.25
diff -u -r1.24 -r1.25
--- Subdetector.java	17 Nov 2010 00:13:44 -0000	1.24
+++ Subdetector.java	3 Dec 2010 01:23:07 -0000	1.25
@@ -1,5 +1,7 @@
 package org.lcsim.geometry.compact;
 
+import java.awt.Color;
+
 import org.jdom.Attribute;
 import org.jdom.Element;
 import org.jdom.JDOMException;
@@ -14,12 +16,12 @@
  * @author Tony Johnson <[log in to unmask]>
  * @author Jeremy McCormick <[log in to unmask]>
  * 
- * @version $Id: Subdetector.java,v 1.24 2010/11/17 00:13:44 jeremy Exp $
+ * @version $Id: Subdetector.java,v 1.25 2010/12/03 01:23:07 jeremy Exp $
  */
 public class Subdetector implements org.lcsim.geometry.Subdetector
 {
     // FIXME: Why is reflect a general attribute of Subdetector?  It only makes
-    //        sense for endcaps!
+    //        sense for endcaps.
     // Make default setting true so that when it isn't set, we get two endcaps as expected.
     private boolean reflect = true;
 
@@ -168,7 +170,15 @@
 
     public VisAttributes getVisAttributes()
     {
-        return this.vis;
+        // Make a default VisAttributes if it is null.
+        if ( vis == null )
+        {
+            vis = new VisAttributes( getName() + "_vis" );
+            
+            // Set color to white so it will show in Wired and Geant4.
+            vis.setColor( Color.WHITE );
+        }
+        return vis;
     }
 
     public Element getNode()
CVSspam 0.2.8