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.Float
height, width, x, y
OUT_BOTTOM, OUT_LEFT, OUT_RIGHT, OUT_TOP
X, Y, Z
U, 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, setRect
add, add, add, contains, contains, equals, getPathIterator, getPathIterator, hashCode, intersect, intersects, intersectsLine, intersectsLine, outcode, setFrame, union
clone, contains, contains, getBounds, getCenterX, getCenterY, getFrame, getMaxX, getMaxY, getMinX, getMinY, intersects, setFrame, setFrame, setFrameFromCenter, setFrameFromCenter, setFrameFromDiagonal, setFrameFromDiagonal
public 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.ID
public String getName()
ViewPort
public ViewPort copy()
ViewPort
public double[] transform(double[] xyz)
ViewPort
public double[][] transform(double[][] xyz, int n)
ViewPort
public double[] deltaTransform(double[] xyz)
ViewPort
deltaTransform
in interface ViewPort
public double[] inverseTransform(double[] uvw)
ViewPort
inverseTransform
in interface ViewPort
public double[] inverseDeltaTransform(double[] uvw)
ViewPort
inverseDeltaTransform
in interface ViewPort
public String toString()
toString
in class 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
Copyright © 1996-2014 FreeHEP. All Rights Reserved.