View Javadoc

1   package org.lcsim.geometry.subdetector;
2   
3   import hep.graphics.heprep.HepRep;
4   import hep.graphics.heprep.HepRepFactory;
5   import hep.graphics.heprep.HepRepType;
6   
7   import org.jdom.Element;
8   import org.jdom.JDOMException;
9   import org.lcsim.detector.converter.heprep.DetectorElementToHepRepConverter;
10  import org.lcsim.geometry.HepRepProvider;
11  
12  /**
13   * This class is meant to simplify the inheritance hierarchy for
14   * org.lcsim.geometry.subdetector implementation classes.
15   * 
16   * @author Jeremy McCormick <jeremym@slac.stanford.edu>
17   * @version $Id: AbstractSubdetector.java,v 1.12 2010/12/03 01:21:39 jeremy Exp $
18   */
19  abstract class AbstractSubdetector extends org.lcsim.geometry.compact.Subdetector implements HepRepProvider
20  {
21      /**
22       * Creates a new instance of AbstractSubdetector
23       */
24      public AbstractSubdetector( Element node ) throws JDOMException
25      {
26          super( node );
27      }
28  
29      /**
30       * HepRepProvider: optional impl for subclass
31       */
32      public void appendHepRep( HepRepFactory factory, HepRep heprep )
33      {       
34          // Let subclasses implement this.
35          
36          // TODO Generic implementation.  Requires depth on VisAttributes.
37          // DetectorElementToHepRepConverter.convert( getDetectorElement(), factory, heprep, getVisAttributes().getDepth(), isEndcap(), getVisAttributes().getColor() );
38      }
39  
40      /**
41       * Assign color to subdetector HepRep if there are VisAttributes.
42       * 
43       * @param type The HepRepType for this subdetector.
44       */
45      /*
46      protected void setHepRepColor( HepRepType type )
47      {
48          if ( getVisAttributes() != null )
49          {
50              type.addAttValue( "color", getVisAttributes().getColor() );
51          }
52      }
53      */
54  }