Print

Print


Commit in GeomConverter/src/org/lcsim/geometry on MAIN
Detector.java+16-81.36 -> 1.37
add check on visibility before Subdetector is put into HepRep scene

GeomConverter/src/org/lcsim/geometry
Detector.java 1.36 -> 1.37
diff -u -r1.36 -r1.37
--- Detector.java	30 Nov 2010 00:16:28 -0000	1.36
+++ Detector.java	3 Dec 2010 01:22:39 -0000	1.37
@@ -7,9 +7,7 @@
 import hep.graphics.heprep.HepRepType;
 import hep.graphics.heprep.HepRepTypeTree;
 
-import java.util.ArrayList;
 import java.util.HashMap;
-import java.util.List;
 import java.util.Map;
 
 import org.jdom.Element;
@@ -23,9 +21,10 @@
  * @author tonyj
  * @author jeremym
  * 
- * @version $Id: Detector.java,v 1.36 2010/11/30 00:16:28 jeremy Exp $
+ * @version $Id: Detector.java,v 1.37 2010/12/03 01:22:39 jeremy Exp $
  */
-// FIXME Determine which methods should go here or on compact Detector.
+// FIXME Determine which methods should go here or on in compact Detector.
+// FIXME Following convention in this package, shouldn't this just be an interface?
 public class Detector extends org.lcsim.geometry.compact.Detector implements HepRepProvider
 {
     private FieldOverlay fieldOverlay = new FieldOverlay();
@@ -70,9 +69,9 @@
     }
 
     /*
-     * FIXME: There is not necessary a 1-to-1 between subdetectors and readouts as implied
-     * here. FIXME: This function is just a hack to setup the IDDecoder. There is probably
-     * a better way to do it.
+     * FIXME There is not necessary a 1-to-1 between subdetectors and readouts as implied here. 
+     * FIXME This function is just a hack to setup the IDDecoder. There is probably
+     *       a better way to do it.
      */
     private void setupIDDecoder( org.lcsim.geometry.compact.Subdetector subdet )
     {
@@ -129,7 +128,16 @@
         {
             if ( sub instanceof HepRepProvider )
             {
-                ( ( HepRepProvider ) sub ).appendHepRep( factory, heprep );
+                // Add Subdetector to HepRep scene but only if visible.
+                if (((org.lcsim.geometry.compact.Subdetector)sub).getVisAttributes().isVisible())
+                {
+                    ( ( HepRepProvider ) sub ).appendHepRep( factory, heprep );
+                }
+                // DEBUG
+                //else
+                //{
+                //    System.out.println("skipped " + ((Subdetector)sub).getName());
+                //}
             }
         }
     }
CVSspam 0.2.8