JClass DesktopViews 6.3.0 API
Documentation

com.klg.jclass.chart3d
Class Transform

java.lang.Object
  |
  +--com.klg.jclass.chart3d.Transform
All Implemented Interfaces:
Serializable

public class Transform
extends Object
implements Serializable

See Also:
Serialized Form

Field Summary
protected  Matrix4d absolute
           
protected  com.klg.jclass.chart3d.JCChart3dArea area
           
static int CORNER_XMAX_YMAX
           
static int CORNER_XMAX_YMIN
           
static int CORNER_XMIN_YMAX
           
static int CORNER_XMIN_YMIN
           
protected  com.klg.jclass.chart3d.JCBox currentViewport
           
static double EDGE_PAD
           
static int EDGE_XMAX
           
static int EDGE_XMIN
           
static int EDGE_YMAX
           
static int EDGE_YMIN
           
static int EDGE_ZMAX
           
static int EDGE_ZMIN
           
protected  Point4d eyePosition
           
static int FACE_ON
           
protected  Matrix4d iAbsolute
           
protected  Matrix4d iRotation
           
protected  Matrix4d iScreen
           
protected  Matrix4d perspective
           
protected  int processingOrder
           
static int ROTATE_180
           
static int ROTATE_270
           
static int ROTATE_90
           
static int ROTATE_NONE
           
protected  Matrix4d rotation
           
protected  Matrix4d screen
           
protected  Matrix4d textView
           
protected  Matrix4d view
           
 
Constructor Summary
Transform()
           
Transform(com.klg.jclass.chart3d.JCChart3dArea area)
           
 
Method Summary
 void adjustForUserViewport(com.klg.jclass.chart3d.JCBox vp, double scale, double horizontalShift, double verticalShift)
          Adjusts the viewport, based on the scale and translations.
protected  void calcProcessingOrder()
          Finds the processing order for the grid facets based on the relative position of the viewpoint to the grid.
protected  void computeAbsoluteMatrix(com.klg.jclass.chart3d.JCBox dataport)
          Squishes data into a ( +/-1, +/-1, +/-1) cube.
 Point4d computeEyePosition()
          Create viewpoint position vector with eye at least at double the unit cube and do an inverse rotation to get it into absolute space.
protected  void computePerspectiveMatrix()
           
 void computeRotationMatrix()
           
protected  void computeScreenMatrix()
          Adjusts projected image to show only what which lies within the viewport.
 void computeTransformations(Graphics gc)
           
protected  void computeViewMatrix()
          Computes a combined xform matrix to take an absolute coordinate system vector and xform it to screen coordinates in one step.
 Matrix4d getAbsolute()
           
 com.klg.jclass.chart3d.JCChart3dArea getChart3dArea()
          Gets the parent chart3d area.
 com.klg.jclass.chart3d.JCBox getCurrentViewport()
           
 Point4d getEyePosition()
           
 Matrix4d getInverseAbsolute()
           
 Matrix4d getInverseRotation()
           
 Matrix4d getInverseScreen()
           
 Matrix4d getPerspective()
           
protected  int getProcessingOrder()
           
 Matrix4d getRotation()
           
 Matrix4d getScreen()
           
 Matrix4d getTextView()
           
 Matrix4d getView()
           
static void rotateMatrix(Matrix4d m, double angle, int axis, boolean doFast)
          Rotates the input matrix by a given angle about the X, Y, or Z axis.
static void rotateMatrix(Matrix4d m, int rotate, int axis)
          Rotates the input matrix by a given predefined angle enum about the X, Y, or Z axis.
static void scaleMatrix(Matrix4d m, double sx, double sy, double sz)
          Scales the input matrix by the given scale factor in x, y, and z.
 void setChart3dArea(com.klg.jclass.chart3d.JCChart3dArea area)
          Sets the parent chart3d area
static void transformPoint(Matrix4d m, Point4d p)
           
static void translateMatrix(Matrix4d m, double tx, double ty, double tz)
          Translates the input matrix by the given translation in x, y, and z.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

EDGE_PAD

public static final double EDGE_PAD
See Also:
Constant Field Values

FACE_ON

public static final int FACE_ON
See Also:
Constant Field Values

EDGE_XMAX

public static final int EDGE_XMAX
See Also:
Constant Field Values

EDGE_XMIN

public static final int EDGE_XMIN
See Also:
Constant Field Values

EDGE_YMAX

public static final int EDGE_YMAX
See Also:
Constant Field Values

EDGE_YMIN

public static final int EDGE_YMIN
See Also:
Constant Field Values

EDGE_ZMAX

public static final int EDGE_ZMAX
See Also:
Constant Field Values

EDGE_ZMIN

public static final int EDGE_ZMIN
See Also:
Constant Field Values

CORNER_XMAX_YMAX

public static final int CORNER_XMAX_YMAX
See Also:
Constant Field Values

CORNER_XMIN_YMAX

public static final int CORNER_XMIN_YMAX
See Also:
Constant Field Values

CORNER_XMAX_YMIN

public static final int CORNER_XMAX_YMIN
See Also:
Constant Field Values

CORNER_XMIN_YMIN

public static final int CORNER_XMIN_YMIN
See Also:
Constant Field Values

ROTATE_NONE

public static final int ROTATE_NONE
See Also:
Constant Field Values

ROTATE_90

public static final int ROTATE_90
See Also:
Constant Field Values

ROTATE_180

public static final int ROTATE_180
See Also:
Constant Field Values

ROTATE_270

public static final int ROTATE_270
See Also:
Constant Field Values

absolute

protected Matrix4d absolute

rotation

protected Matrix4d rotation

perspective

protected Matrix4d perspective

screen

protected Matrix4d screen

view

protected Matrix4d view

textView

protected Matrix4d textView

iAbsolute

protected Matrix4d iAbsolute

iRotation

protected Matrix4d iRotation

iScreen

protected Matrix4d iScreen

eyePosition

protected Point4d eyePosition

currentViewport

protected com.klg.jclass.chart3d.JCBox currentViewport

processingOrder

protected int processingOrder

area

protected com.klg.jclass.chart3d.JCChart3dArea area
Constructor Detail

Transform

public Transform()

Transform

public Transform(com.klg.jclass.chart3d.JCChart3dArea area)
Method Detail

getChart3dArea

public com.klg.jclass.chart3d.JCChart3dArea getChart3dArea()
Gets the parent chart3d area.

Returns:
The parent JCChart3dArea object

setChart3dArea

public void setChart3dArea(com.klg.jclass.chart3d.JCChart3dArea area)
Sets the parent chart3d area

Parameters:
area -

getAbsolute

public Matrix4d getAbsolute()

getRotation

public Matrix4d getRotation()

getPerspective

public Matrix4d getPerspective()

getScreen

public Matrix4d getScreen()

getView

public Matrix4d getView()

getTextView

public Matrix4d getTextView()

getInverseAbsolute

public Matrix4d getInverseAbsolute()

getInverseRotation

public Matrix4d getInverseRotation()

getInverseScreen

public Matrix4d getInverseScreen()

getEyePosition

public Point4d getEyePosition()

getCurrentViewport

public com.klg.jclass.chart3d.JCBox getCurrentViewport()

getProcessingOrder

protected int getProcessingOrder()

rotateMatrix

public static void rotateMatrix(Matrix4d m,
                                int rotate,
                                int axis)
Rotates the input matrix by a given predefined angle enum about the X, Y, or Z axis.

Parameters:
m -
rotate -
axis -

rotateMatrix

public static void rotateMatrix(Matrix4d m,
                                double angle,
                                int axis,
                                boolean doFast)
Rotates the input matrix by a given angle about the X, Y, or Z axis.

Parameters:
m -
angle -
axis -
doFast -

scaleMatrix

public static void scaleMatrix(Matrix4d m,
                               double sx,
                               double sy,
                               double sz)
Scales the input matrix by the given scale factor in x, y, and z. If doFast is true, we assume that all but one of the scale factors is equal to 1 and thus scaling can be optimized.

Parameters:
m -
sx -
sy -
sz -

translateMatrix

public static void translateMatrix(Matrix4d m,
                                   double tx,
                                   double ty,
                                   double tz)
Translates the input matrix by the given translation in x, y, and z.

Parameters:
m -
tx -
ty -
tz -

transformPoint

public static void transformPoint(Matrix4d m,
                                  Point4d p)

adjustForUserViewport

public void adjustForUserViewport(com.klg.jclass.chart3d.JCBox vp,
                                  double scale,
                                  double horizontalShift,
                                  double verticalShift)
Adjusts the viewport, based on the scale and translations.

Parameters:
vp - The current viewport
scale - The scale to apply to the viewport
horizontalShift - The horizontal shift to apply to the viewport
verticalShift - The vertical shift to apply to the viewport

computeEyePosition

public Point4d computeEyePosition()
Create viewpoint position vector with eye at least at double the unit cube and do an inverse rotation to get it into absolute space.


computeAbsoluteMatrix

protected void computeAbsoluteMatrix(com.klg.jclass.chart3d.JCBox dataport)
Squishes data into a ( +/-1, +/-1, +/-1) cube.

Parameters:
dataport -

computeRotationMatrix

public void computeRotationMatrix()

computePerspectiveMatrix

protected void computePerspectiveMatrix()

computeScreenMatrix

protected void computeScreenMatrix()
Adjusts projected image to show only what which lies within the viewport. Note: To keep the aspect ratio fixed the viewport should be square. So we use the smallest dimension (width or height) to represent the square viewport.


computeTransformations

public void computeTransformations(Graphics gc)

computeViewMatrix

protected void computeViewMatrix()
Computes a combined xform matrix to take an absolute coordinate system vector and xform it to screen coordinates in one step. Also computes text viewing matrix: textView = [screen][perspective][rotation]. This is a special 'text version' of xrt->vm since the text does not need to be transformed from data space first (ie. no absolute).


calcProcessingOrder

protected void calcProcessingOrder()
Finds the processing order for the grid facets based on the relative position of the viewpoint to the grid.


Copyright © 2004 Quest Software Inc..
All rights reserved.