View Javadoc

1   package org.lcsim.detector;
2   
3   import hep.physics.vec.Hep3Vector;
4   
5   /**
6    * This interface provides utilities for returning {@link org.lcsim.detector.IPhysicalVolumePath}
7    * objects that represent a volume's unique position in the physical geometry tree with
8    * an ordered list of physical volumes.  This class can calculate the combined geometric 
9    * transform of an IPhysicalVolumePath.
10   * 
11   * @author Jeremy McCormick <jeremym@slac.stanford.edu>
12   * @version $Id: IPhysicalVolumeNavigator.java,v 1.11 2010/04/14 17:52:32 jeremy Exp $
13   */
14  public interface IPhysicalVolumeNavigator 
15  {
16  	public String getName();
17  	
18  	/**
19  	 * Get the top physical volume assigned to
20  	 * this navigator.
21  	 * 
22  	 * @return The top or world volume.
23  	 */
24  	public IPhysicalVolume getTopPhysicalVolume();
25  	
26  	/**
27  	 * Set the top physical volume assigned to 
28  	 * this navigator.
29  	 * 
30  	 * @param physvol A top volume.
31  	 */
32  	public void setTopPhysicalVolume(IPhysicalVolume physvol);
33  	
34  	/**
35  	 * 
36  	 * Get the full stack of {@link IPhysicalVolume}s from a path string
37  	 * of names.
38       *
39  	 * <code>
40  	 * getPath("/volume_name/subvolume_name")
41  	 * <code> 
42       
43  	 * @param path A String with the path name.
44  	 * @return IPhysicalVolumePath corresponding to the name.
45  	 */
46  	public IPhysicalVolumePath getPath(String path);	
47  
48  	/**
49  	 * 
50  	 * Get the full transformation from the origin of
51  	 * the coordinate system to the given path.
52  	 * 
53  	 * @param path The path of volumes.
54  	 * @return Transform from a path.
55  	 */
56  	public Transform3D getTransform(String path);
57  	
58  	/**
59  	 * Get the full transformation from the origin of
60  	 * the coordinate system from a stack of physical volumes.
61  	 * 
62  	 * @param path The path of volumes.
63  	 * @return The full transform from the path.
64  	 */
65  	Transform3D getTransform(IPhysicalVolumePath path);
66  
67  	/**
68  	 * Given a global point, return the full path to
69  	 * deepest volume containing this point, not past
70       * given depth.
71  	 * 
72  	 * @param globalPoint A point in the global coordinate system.
73  	 * @param level Max depth.  -1 will go to bottom.
74  	 * @return Path down to the given level.
75  	 */
76  	public IPhysicalVolumePath getPath(Hep3Vector globalPoint, int level);
77  	
78  	/**
79  	 * Same as {@link #getPath(Hep3Vector globalPoint, int level)}
80       * with level set to -1.
81  	 * 
82  	 * @param globalPoint A point in the global coordinate system.
83  	 * @return Path at the point.
84  	 */
85  	public IPhysicalVolumePath getPath(Hep3Vector globalPoint);	
86  	 
87  	/**
88  	 * Traverse the tree using preorder, calling the visit method 
89  	 * of the {@link IPhysicalVolumeVisitor}.
90  	 * 
91  	 * @param visitor An IPhysicalVolumeVisitor that will be activated
92  	 *                at each PhysicalVolume in the tree.
93  	 */
94  	public void traversePreOrder(IPhysicalVolumeVisitor visitor);
95  	
96  	/**
97  	 * Traverse the tree using postorder, calling the visit method 
98  	 * of the {@link IPhysicalVolumeVisitor}.
99  	 * 
100 	 * @param visitor An IPhysicalVolumeVisitor that will be activated
101 	 *                at each PhysicalVolume in the tree.
102 	 */
103 	public void traversePostOrder(IPhysicalVolumeVisitor visitor);	
104 }