GeomConverter/sandbox/tknelson_snapshot
diff -N GeometryInfo.java
--- GeometryInfo.java 27 Feb 2007 19:59:20 -0000 1.1
+++ /dev/null 1 Jan 1970 00:00:00 -0000
@@ -1,101 +0,0 @@
-/*
- * GeometryInfo.java
- *
- * Created on November 6, 2006, 11:12 AM
- *
- * To change this template, choose Tools | Template Manager
- * and open the template in the editor.
- */
-
-import hep.physics.vec.Hep3Vector;
-import java.util.List;
-
-/**
- *
- * @author tknelson
- */
-public class GeometryInfo implements IGeometryInfo
-{
-
- // Fields
- //=======
- CoordinateTransformation3D _global_to_local;
- CoordinateTransformation3D _local_to_global;
- LVolume _logical_volume;
- List<PVolume> _daughter_volumes;
-
- /** Creates a new instance of GeometryInfo */
- public GeometryInfo(CoordinateTransformation3D global_to_local, LVolume logical_volume)
- {
- _global_to_local = global_to_local;
- _local_to_global = global_to_local.inverse();
- _logical_volume = logical_volume;
- }
-
- // Accessors
- public CoordinateTransformation3D getGlobalToLocal()
- {
- return _global_to_local;
- }
-
- public CoordinateTransformation3D getLocalToGlobal()
- {
- return _local_to_global;
- }
-
- public Hep3Vector globalToLocal(Hep3Vector global_point)
- {
- return _global_to_local.transform(global_point);
- }
-
- public Hep3Vector localToGlobal(Hep3Vector local_point)
- {
- return _local_to_global.transform(local_point);
- }
-
- public String childVolumeName(Hep3Vector global_point)
- {
- Hep3Vector parent_point = globalToLocal(global_point);
- List<PVolume> daughter_volumes = getLogicalVolume().getDaughters();
-
- String volume_name = "";
- for (PVolume daughter_volume : _daughter_volumes)
- {
- if (daughter_volume.getLogicalVolume().getSolid().isInside(daughter_volume.parentToLocal(parent_point)));
- {
- volume_name = daughter_volume.getLogicalVolume().getName();
- break;
- }
- }
- return volume_name;
- }
-
- public PVolume childVolume(Hep3Vector global_point)
- {
- Hep3Vector parent_point = globalToLocal(global_point);
- List<PVolume> daughter_volumes = getLogicalVolume().getDaughters();
-
- PVolume volume = null;
- for (PVolume daughter_volume : _daughter_volumes)
- {
- if (daughter_volume.getLogicalVolume().getSolid().isInside(daughter_volume.parentToLocal(parent_point)));
- {
- volume = daughter_volume;
- break;
- }
- }
- return volume;
- }
-
- public boolean isInside(Hep3Vector global_point)
- {
- return getLogicalVolume().getSolid().isInside(globalToLocal(global_point));
- }
-
- public LVolume getLogicalVolume()
- {
- return _logical_volume;
- }
-
-
-}
\ No newline at end of file