View Javadoc

1   // Copyright 2004-2005, FreeHEP.
2   package hep.wired.services;
3   
4   import org.freehep.xml.io.XMLIO;
5   
6   import hep.wired.util.XYZindices;
7   import hep.wired.util.UVWindices;
8   import hep.wired.util.WiredRegistry;
9   
10  /***
11   * Transforms coordinates in a world-unit system (X,Y,Z) with intervals (-1,1) into
12   * screen coordinates (U,V,W).
13   * 
14   * @author Mark Donszelmann
15   * @version $Id: ViewPort.java 2083 2005-07-20 17:16:52Z duns $
16   */
17  
18  public interface ViewPort extends WiredRegistry.ID, XYZindices, UVWindices, XMLIO {
19  
20      /***
21       * Returns the name of the View Port.
22       */
23      public String getName();
24      
25      /***
26       * Returns a copy of the viewport
27       */
28      public ViewPort copy();
29  
30      /***
31       * Returns an array of length 3: uvw = viewport(xyz). 
32       * The z component is not touched.
33       * The returned array may have a lifetime up to the next call to this method
34       * on this object.
35       */
36      public double[] transform(double[] xyz);   
37      
38      /***
39       * Returns an array of length 3*n: uvw[][n] = viewport(xyz[][n]). 
40       * The z component is not touched.
41       * The returned array may have a lifetime up to the next call to this method
42       * on this object. The number of "valid" coordinates is given by n.
43       */
44      public double[][] transform(double[][] xyz, int n);   
45  
46      /***
47       * Returns an array of length 3: uvw[] = viewport-delta(xyz[]). 
48       * The z component is not touched.
49       * The returned array may have a lifetime up to the next call to this method
50       * on this object.
51       */
52      public double[] deltaTransform(double[] xyz);
53  
54      /***
55       * Returns an array of length 3: xyz[] = inverse-viewport(uvw[]). 
56       * The w component is not touched.
57       * The returned array may have a lifetime up to the next call to this method
58       * on this object.
59       */
60      public double[] inverseTransform(double[] uvw);
61  
62      /***
63       * Returns an array of length 3: xyz[] = inverse-viewport-delta(uvw[]). 
64       * The w component is not touched.
65       * The returned array may have a lifetime up to the next call to this method
66       * on this object.
67       */
68      public double[] inverseDeltaTransform(double[] uvw);      
69  }