Commit in GeomConverter/src/org/lcsim/geometry/compact/converter/svg on MAIN
SvgConverter.java+30-21.3 -> 1.4
additions to Svg converter

GeomConverter/src/org/lcsim/geometry/compact/converter/svg
SvgConverter.java 1.3 -> 1.4
diff -u -r1.3 -r1.4
--- SvgConverter.java	27 Jan 2011 01:08:52 -0000	1.3
+++ SvgConverter.java	9 Feb 2011 01:10:15 -0000	1.4
@@ -11,6 +11,7 @@
 import org.lcsim.detector.IDetectorElement;
 import org.lcsim.detector.solids.Tube;
 import org.lcsim.geometry.Calorimeter;
+import org.lcsim.geometry.Calorimeter.CalorimeterType;
 import org.lcsim.geometry.Tracker;
 import org.lcsim.geometry.compact.Detector;
 import org.lcsim.geometry.compact.Subdetector;
@@ -304,10 +305,10 @@
             // Get Calorimeter generic parameters.
             Calorimeter cal = (Calorimeter)subdet;
             double innerR = cal.getInnerRadius();
-            double outerR = cal.getOuterRadius();
+            double outerR = cal.getOuterRadius();            
             double halfZ = cal.getZLength() / 2;
             double zlength = cal.getZLength();
-
+            
             // The labels group is accessed statically to avoid having to pass it down.
             Element labelGroup = labelsY;
 
@@ -355,6 +356,18 @@
 
                 // Increment for next label.
                 zLabelOffsetY += 25;
+                
+                Calorimeter.CalorimeterType calType = cal.getCalorimeterType();
+                System.out.println(calType.toString());
+                if (!calType.equals(CalorimeterType.UNKNOWN))
+                {
+                    String calLabel = calType.toString().replace("_BARREL", "");
+                    double calThickness = outerR - innerR;
+                    double y = (maxY - outerR) + calThickness / 2;
+                    y *= scale;
+                    Element calText = text(labelsY, calLabel, 80, y + 5);
+                    calText.setAttribute("font-size", "12");
+                }
             }
             // Draw endcap calorimeters that are reflected.
             else if (subdet.isEndcap() && subdet.getReflect())
@@ -391,6 +404,8 @@
             // Draw barrel trackers.
             if (subdet instanceof SiTrackerBarrel || subdet instanceof MultiLayerTracker)
             {
+                double minR = 9999999.;
+                double maxR = 0;
                 // Loop over SiTrackerBarrel layers.
                 IDetectorElement de = subdet.getDetectorElement();
                 for (IDetectorElement layer : de.getChildren())
@@ -402,6 +417,16 @@
                     double halfZ = tube.getZHalfLength();
                     double outerR = tube.getOuterRadius();
                     double innerR = tube.getInnerRadius();
+                    
+                    if (innerR < minR)
+                    {
+                        minR = innerR;
+                    }
+                    
+                    if (outerR > maxR)
+                    {
+                        maxR = outerR;
+                    }
 
                     // Draw a line for this tracker layer.
                     if (thickness < minTrackerLayerThickness)
@@ -419,6 +444,9 @@
                         rect(g, 0., maxY - outerR, outerR - innerR, halfZ);
                     }
                 }
+                
+                System.out.println("maxR = " + maxR);
+                System.out.println("minR = " + minR);
             }
             // Draw DiskTracker.
             // FIXME Replace compact based code with IDetectorElement, but DiskTracker
CVSspam 0.2.8