- All Implemented Interfaces:
The transform that should be applied when an Exhibit is drawn. This class represents a 2D "Window-to-Viewport" transformation. (A 3D transform subclass will also include the projection transformation from 3D to 2D.) For example, an object of this type is used as a parmeter to
- Direct Known Subclasses:
vmm3d.core.Exhibit#doDraw(Graphics2D, View, Transform).
An object of this class represents a rectangular "window" in the xy-plane and possibly a corresponding rectagular "viewport" of pixels. (The viewport is only valid during actual drawing operations, where the destination of the drawing is known; however, the transform is only likely to be used when this is true.) The window-to-viewport transformation is the one that is applied to xy-coordinates to transform them to pixel coordinates -- this transformation can be applied either automatically (when the
apply2DTransformparameter to the
setUpDrawInfo(org.freehep.graphics2d.VectorGraphics, int, int, int, int, boolean, boolean)method is set to true), or it can be performed by hand using information contained in the Transform object.
The rectangle in the xy-plane is represented by four numbers xmin, xmax, ymin, and ymax. The pixel area is represented by the coordinates of its upper left corner (x and y) and by its width and height. The values of x, y, width, and height can be set only by calling the
setUpDrawInfomethod. Otherwise, they are 0. Note that this class does NOT enforce xmax greater than xmin or ymax greater than ymin. It does enforce that width and height are greater than 0. Note that the xmin, xmax, ymin, ymax might be adjusted from the values requested when
setUpDrawInfois called with
preserveAspectset to true.
A Transform emits a ChangeEvent when the requested window (xmin,xmax,ymin,ymax) changes; it does not emit a ChangeEvent when the viewport (pixel rectangle to which the window is mapped) changes. A Transform3D also emits a ChangeEvent when the 3D view changes.