public class PhysicalVolumeNavigator extends Object implements IPhysicalVolumeNavigator
Modifier and Type | Field and Description |
---|---|
(package private) String |
name |
private IPhysicalVolume |
pvTop |
Constructor and Description |
---|
PhysicalVolumeNavigator(String name,
IPhysicalVolume pvTop) |
PhysicalVolumeNavigator(String name,
IPhysicalVolumePath path) |
Modifier and Type | Method and Description |
---|---|
static void |
getLeafPaths(Collection<String> paths,
IPhysicalVolume node,
String path)
Utility method for getting String paths to leaf volumes.
|
String |
getName() |
IPhysicalVolumePath |
getPath(Hep3Vector globalPoint)
Get the IPhysicalVolumePath to the deepest PhysicalVolume
in the tree containing the global point @param globalPoint,
relative to the top volume.
|
IPhysicalVolumePath |
getPath(Hep3Vector globalPoint,
int level)
Find the full geometry path to the PhysicalVolume containing
the global point @param globalPoint, relative to the world volume.
|
IPhysicalVolumePath |
getPath(String path)
Get the IPhysicalVolumePath from a String @param path argument.
|
IPhysicalVolumePath |
getPath(String[] path)
This is the primary method for navigating
using PhysicalVolume names.
|
IPhysicalVolume |
getTopPhysicalVolume()
Get the top volume of this navigator.
|
Transform3D |
getTransform(IPhysicalVolumePath path)
Compute the combined global to local transform from a path of PhysicalVolumes.
|
Transform3D |
getTransform(String path)
Get the combined transform from a String path.
|
void |
setTopPhysicalVolume(IPhysicalVolume physvol)
Set the top volume of this navigator.
|
void |
setTopPhysicalVolume(IPhysicalVolumePath path)
Sets the top volume of this navigator
from the top node of an IPhysicalVolumePath.
|
private static String[] |
splitPath(String path)
Utility method for dealing with strings
containing slash-delimited volume names.
|
protected void |
traversePostOrder(IPhysicalVolume physicalVolume,
IPhysicalVolumeVisitor visitor)
Visit each PhysicalVolume recursively using postorder,
calling the given IPhysicalVolumeVisitor's visit method
for each node.
|
void |
traversePostOrder(IPhysicalVolumeVisitor visitor)
Visit the top volume recursively using postorder,
calling the given IPhysicalVolumeVisitor's visit method
for each node.
|
protected void |
traversePreOrder(IPhysicalVolume physicalVolume,
IPhysicalVolumeVisitor visitor)
Visit the PhysicalVolume recursively using preorder,
calling the given IPhysicalVolumeVisitor's visit method
for each node.
|
void |
traversePreOrder(IPhysicalVolumeVisitor visitor)
Traverse the tree using preorder, calling the visit method
of the
IPhysicalVolumeVisitor . |
String name
private IPhysicalVolume pvTop
public PhysicalVolumeNavigator(String name, IPhysicalVolume pvTop)
public PhysicalVolumeNavigator(String name, IPhysicalVolumePath path)
public IPhysicalVolumePath getPath(Hep3Vector globalPoint, int level)
getPath
in interface IPhysicalVolumeNavigator
globalPoint
- Point in top geometry system.level
- Depth to descend. -1 means to bottom.public IPhysicalVolumePath getPath(Hep3Vector globalPoint)
getPath
in interface IPhysicalVolumeNavigator
globalPoint
- A point in the global coordinate system.public Transform3D getTransform(String path)
getTransform
in interface IPhysicalVolumeNavigator
path
- A valid path into the geometry tree.public Transform3D getTransform(IPhysicalVolumePath path)
getTransform
in interface IPhysicalVolumeNavigator
path
- The PhysicalVolumePath containing the unique geometry node.private static String[] splitPath(String path)
path
- public IPhysicalVolumePath getPath(String[] path)
path
- public IPhysicalVolumePath getPath(String path)
getPath
in interface IPhysicalVolumeNavigator
path
- A String with the path name.public IPhysicalVolume getTopPhysicalVolume()
getTopPhysicalVolume
in interface IPhysicalVolumeNavigator
public void setTopPhysicalVolume(IPhysicalVolume physvol)
setTopPhysicalVolume
in interface IPhysicalVolumeNavigator
physvol
- A PhysicalVolume that cannot be null.public void setTopPhysicalVolume(IPhysicalVolumePath path)
path
- public void traversePreOrder(IPhysicalVolumeVisitor visitor)
IPhysicalVolumeNavigator
IPhysicalVolumeVisitor
.traversePreOrder
in interface IPhysicalVolumeNavigator
visitor
- An IPhysicalVolumeVisitor that will be activated
at each PhysicalVolume in the tree.protected void traversePreOrder(IPhysicalVolume physicalVolume, IPhysicalVolumeVisitor visitor)
physicalVolume
- visitor
- protected void traversePostOrder(IPhysicalVolume physicalVolume, IPhysicalVolumeVisitor visitor)
physicalVolume
- visitor
- public void traversePostOrder(IPhysicalVolumeVisitor visitor)
traversePostOrder
in interface IPhysicalVolumeNavigator
visitor
- A visitor to process the nodes.public String getName()
getName
in interface IPhysicalVolumeNavigator
public static void getLeafPaths(Collection<String> paths, IPhysicalVolume node, String path)
paths
- List of paths passed in by caller.node
- The top node to traverse.path
- The recursive path String.Copyright © 2016 Linear Collider Detector (LCD). All rights reserved.