GeomConverter/src/org/lcsim/detector/solids
diff -u -r1.2 -r1.3
--- Trd.java 6 Aug 2007 19:09:32 -0000 1.2
+++ Trd.java 9 Aug 2007 22:36:37 -0000 1.3
@@ -1,5 +1,6 @@
package org.lcsim.detector.solids;
+import hep.physics.vec.BasicHep3Vector;
import hep.physics.vec.Hep3Vector;
import static java.lang.Math.abs;
import static org.lcsim.detector.solids.Inside.INSIDE;
@@ -11,7 +12,7 @@
* <a href="http://www.lcsim.org/software/geant4/doxygen/html/classG4Trd.html">G4Trd class</a>.
*
* @author Jeremy McCormick
- * @version $Id: Trd.java,v 1.2 2007/08/06 19:09:32 jeremy Exp $
+ * @version $Id: Trd.java,v 1.3 2007/08/09 22:36:37 jeremy Exp $
*/
public class Trd
extends AbstractSolid
@@ -49,33 +50,24 @@
}
/**
- * True if point <code>p</code> is inside the shape.
- * False if the point is outside the shape or on the surface.
+ * Get an array containing the 8 corner points of this trapezoid.
*/
- /*
- public boolean isInside(Hep3Vector p)
- {
- boolean in=false;
-
- double x,y,zbase1,zbase2;
-
- if (abs(p.z())<=dz-tolerance/2)
- {
- zbase1=p.z()+dz;
- zbase2=dz-p.z();
-
- x=0.5*(dx2*zbase1+dx1*zbase2)/dz - tolerance/2;
- if (abs(p.x())<=x)
- {
- y=0.5*((dy2*zbase1+dy1*zbase2))/dz - tolerance/2;
- if (abs(p.y())<=y)
- {
- in=true;
- }
- }
- }
- return in;
- }*/
+ public Hep3Vector[] getPoints()
+ {
+ Hep3Vector points[] = new Hep3Vector[8];
+
+ points[0] = new BasicHep3Vector(-dx1,-dy1,dz);
+ points[1] = new BasicHep3Vector(-dx1,dy1,dz);
+ points[2] = new BasicHep3Vector(dx1,dy1,dz);
+ points[3] = new BasicHep3Vector(dx1,-dy1,dz);
+
+ points[4] = new BasicHep3Vector(-dx2,-dy2,-dz);
+ points[5] = new BasicHep3Vector(-dx2,dy2,-dz);
+ points[6] = new BasicHep3Vector(dx2,dy2,-dz);
+ points[7] = new BasicHep3Vector(dx2,-dy2,-dz);
+
+ return points;
+ }
public Inside inside(Hep3Vector p)
{