public class RectangularViewPort extends Rectangle2D.Double implements ViewPort
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]).
Rectangle2D.Double, Rectangle2D.Floatheight, width, x, yOUT_BOTTOM, OUT_LEFT, OUT_RIGHT, OUT_TOPX, Y, ZU, V, W| Constructor and Description |
|---|
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(Rectangle2D r,
int componentWidth,
int componentHeight)
Creates a rectangular viewport from given rectangle.
|
| Modifier and Type | Method and Description |
|---|---|
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() |
String |
getID() |
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) |
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]).
|
createIntersection, createUnion, getBounds2D, getHeight, getWidth, getX, getY, isEmpty, outcode, setRect, setRectadd, add, add, contains, contains, equals, getPathIterator, getPathIterator, hashCode, intersect, intersects, intersectsLine, intersectsLine, outcode, setFrame, unionclone, contains, contains, getBounds, getCenterX, getCenterY, getFrame, getMaxX, getMaxY, getMinX, getMinY, intersects, setFrame, setFrame, setFrameFromCenter, setFrameFromCenter, setFrameFromDiagonal, setFrameFromDiagonalpublic RectangularViewPort()
public RectangularViewPort(Rectangle2D r, int componentWidth, int componentHeight)
public RectangularViewPort(double x,
double y,
double width,
double height,
int componentWidth,
int componentHeight)
public int getComponentWidth()
public int getComponentHeight()
public String getID()
getID in interface WiredRegistry.IDpublic String getName()
ViewPortpublic ViewPort copy()
ViewPortpublic double[] transform(double[] xyz)
ViewPortpublic double[][] transform(double[][] xyz,
int n)
ViewPortpublic double[] deltaTransform(double[] xyz)
ViewPortdeltaTransform in interface ViewPortpublic double[] inverseTransform(double[] uvw)
ViewPortinverseTransform in interface ViewPortpublic double[] inverseDeltaTransform(double[] uvw)
ViewPortinverseDeltaTransform in interface ViewPortpublic String toString()
toString in class Rectangle2D.Doublepublic void save(org.freehep.xml.io.XMLIOManager xmlioManager,
org.jdom.Element nodeEl)
save in interface org.freehep.xml.io.XMLIOpublic void restore(org.freehep.xml.io.XMLIOManager xmlioManager,
org.jdom.Element nodeEl)
restore in interface org.freehep.xml.io.XMLIOCopyright © 1996-2014 FreeHEP. All Rights Reserved.