|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjava.awt.geom.RectangularShape
java.awt.geom.Rectangle2D
java.awt.geom.Rectangle2D.Double
hep.wired.viewport.RectangularViewPort
public class RectangularViewPort
Defines a Rectangular Viewport using x0, y0, width and height. Applies the viewport functions:
u = (x + 1) * width / 2 + x0;
v = height - (y + 1) * height / 2 + y0;
w = (z + 1) * width / 2 + x0; // NOTE: this is done to be able to calculate bounding boxes in Z.
given rectangle(x0, y0, width, height).
This projects a viewport of ([-1,1],[-1,1]) onto ([x0,y0+height],[x0+width,y0]).
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from class java.awt.geom.Rectangle2D |
|---|
java.awt.geom.Rectangle2D.Double, java.awt.geom.Rectangle2D.Float |
| Field Summary |
|---|
| Fields inherited from class java.awt.geom.Rectangle2D.Double |
|---|
height, width, x, y |
| Fields inherited from class java.awt.geom.Rectangle2D |
|---|
OUT_BOTTOM, OUT_LEFT, OUT_RIGHT, OUT_TOP |
| Fields inherited from interface hep.wired.util.XYZindices |
|---|
X, Y, Z |
| Fields inherited from interface hep.wired.util.UVWindices |
|---|
U, V, W |
| Constructor Summary | |
|---|---|
RectangularViewPort()
Creates a rectangular viewport of (0, 0, 800, 600). |
|
RectangularViewPort(double x,
double y,
double width,
double height,
int componentWidth,
int componentHeight)
Creates a rectangular viewport from given parameters. |
|
RectangularViewPort(java.awt.geom.Rectangle2D r,
int componentWidth,
int componentHeight)
Creates a rectangular viewport from given rectangle. |
|
| Method Summary | |
|---|---|
ViewPort |
copy()
Returns a copy of the viewport |
double[] |
deltaTransform(double[] xyz)
Returns an array of length 3: uvw[] = viewport-delta(xyz[]). |
int |
getComponentHeight()
|
int |
getComponentWidth()
|
java.lang.String |
getID()
|
java.lang.String |
getName()
Returns the name of the View Port. |
double[] |
inverseDeltaTransform(double[] uvw)
Returns an array of length 3: xyz[] = inverse-viewport-delta(uvw[]). |
double[] |
inverseTransform(double[] uvw)
Returns an array of length 3: xyz[] = inverse-viewport(uvw[]). |
void |
restore(org.freehep.xml.io.XMLIOManager xmlioManager,
org.jdom.Element nodeEl)
|
void |
save(org.freehep.xml.io.XMLIOManager xmlioManager,
org.jdom.Element nodeEl)
|
java.lang.String |
toString()
|
double[] |
transform(double[] xyz)
Returns an array of length 3: uvw = viewport(xyz). |
double[][] |
transform(double[][] xyz,
int n)
Returns an array of length 3*n: uvw[][n] = viewport(xyz[][n]). |
| Methods inherited from class java.awt.geom.Rectangle2D.Double |
|---|
createIntersection, createUnion, getBounds2D, getHeight, getWidth, getX, getY, isEmpty, outcode, setRect, setRect |
| Methods inherited from class java.awt.geom.Rectangle2D |
|---|
add, add, add, contains, contains, equals, getPathIterator, getPathIterator, hashCode, intersect, intersects, intersectsLine, intersectsLine, outcode, setFrame, union |
| Methods inherited from class java.awt.geom.RectangularShape |
|---|
clone, contains, contains, getBounds, getCenterX, getCenterY, getFrame, getMaxX, getMaxY, getMinX, getMinY, intersects, setFrame, setFrame, setFrameFromCenter, setFrameFromCenter, setFrameFromDiagonal, setFrameFromDiagonal |
| Methods inherited from class java.lang.Object |
|---|
finalize, getClass, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public RectangularViewPort()
public RectangularViewPort(java.awt.geom.Rectangle2D r,
int componentWidth,
int componentHeight)
public RectangularViewPort(double x,
double y,
double width,
double height,
int componentWidth,
int componentHeight)
| Method Detail |
|---|
public int getComponentWidth()
public int getComponentHeight()
public java.lang.String getID()
getID in interface WiredRegistry.IDpublic java.lang.String getName()
ViewPort
getName in interface ViewPortpublic ViewPort copy()
ViewPort
copy in interface ViewPortpublic double[] transform(double[] xyz)
ViewPort
transform in interface ViewPort
public double[][] transform(double[][] xyz,
int n)
ViewPort
transform in interface ViewPortpublic double[] deltaTransform(double[] xyz)
ViewPort
deltaTransform in interface ViewPortpublic double[] inverseTransform(double[] uvw)
ViewPort
inverseTransform in interface ViewPortpublic double[] inverseDeltaTransform(double[] uvw)
ViewPort
inverseDeltaTransform in interface ViewPortpublic java.lang.String toString()
toString in class java.awt.geom.Rectangle2D.Double
public void save(org.freehep.xml.io.XMLIOManager xmlioManager,
org.jdom.Element nodeEl)
save in interface org.freehep.xml.io.XMLIO
public void restore(org.freehep.xml.io.XMLIOManager xmlioManager,
org.jdom.Element nodeEl)
restore in interface org.freehep.xml.io.XMLIO
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||