com.mascotcapsule.micro3d.v3
Class FigureLayout

java.lang.Object
  extended bycom.mascotcapsule.micro3d.v3.FigureLayout

public class FigureLayout
extends java.lang.Object

This class holds the model rendering data. It holds the required data, specifically the orientation, position and size of a model when rendering to a meta frame buffer, such as an actual screen.


Constructor Summary
FigureLayout()
          Generates a rendering data object.
FigureLayout(AffineTrans trans, int sx, int sy, int cx, int cy)
          Generates a rendering data object.
 
Method Summary
 AffineTrans getAffineTrans()
          Gets the affine transformation object settings.
 int getCenterX()
          Gets the center position x coordinate setting.
 int getCenterY()
          Gets the center position y coordinate setting.
 int getParallelHeight()
          Gets parallel projection surface height settings.
 int getParallelWidth()
          Gets parallel projection surface width settings.
 int getScaleX()
          Gets the x axis direction scale value setting.
 int getScaleY()
          Gets the y axis direction scale value setting.
 void selectAffineTrans(int idx)
          Sets one of the affine transformation sets entered for this object as the actual affine transformation to be used.
 void setAffineTrans(AffineTrans trans)
          Sets the affine transformation object.
 void setAffineTrans(AffineTrans[] trans)
          Enters a reference to affine transformation object set.
 void setAffineTransArray(AffineTrans[] trans)
          Deprecated. Method to be eliminated in the near future.
 void setCenter(int cx, int cy)
          Sets the center position coordinates.
 void setParallelSize(int w, int h)
          Enters the parallel projection surface width and height.
 void setPerspective(int zNear, int zFar, int angle)
          Specifies the angle of view and enters the prespective projection settings.
 void setPerspective(int zNear, int zFar, int width, int height)
          Specifies the width and height of the projection surface of the near-clipped surface and enters the perspective projection settings.
 void setScale(int sx, int sy)
          Enters the scale value.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FigureLayout

public FigureLayout()
Generates a rendering data object. The settings are for no direction specification, parallel projection, and a scale of 512. The results are the same as those when FigureLayout(null, 512, 512, 0, 0) is called.


FigureLayout

public FigureLayout(AffineTrans trans,
                    int sx,
                    int sy,
                    int cx,
                    int cy)
Generates a rendering data object. Settings are the same as when setAffineTrans(trans);, setScale(sx, sy); and setCenter(cx, cy); are called in sequence.

Parameters:
trans - Affine transform (no transformation when null)
sx - Scale value in the x axis direction
sy - Scale value in the y axis direction
cx - The x coordinate in the center of the rendering range
cy - The y coordinate in the center of the rendering range
Method Detail

getAffineTrans

public final AffineTrans getAffineTrans()
Gets the affine transformation object settings.

Returns:
Affine transformation

setAffineTrans

public final void setAffineTrans(AffineTrans trans)
Sets the affine transformation object.

Parameters:
trans - Affine transformation (no transformation if null)

setAffineTransArray

public final void setAffineTransArray(AffineTrans[] trans)
Deprecated. Method to be eliminated in the near future.

See Also:
setAffineTrans(AffineTrans[])

setAffineTrans

public final void setAffineTrans(AffineTrans[] trans)
Enters a reference to affine transformation object set. The selectAffineTrans() method is used when actually setting the the affine transformation.

Parameters:
trans - Affine transformation set
Throws:
java.lang.NullPointerException - When either argument trans is null or any of the elements is null.

selectAffineTrans

public final void selectAffineTrans(int idx)
Sets one of the affine transformation sets entered for this object as the actual affine transformation to be used.

Parameters:
idx - Index value
Throws:
java.lang.IllegalArgumentException - When argument idx is false.

getScaleX

public final int getScaleX()
Gets the x axis direction scale value setting.

Returns:
The x axis direction scale value

getScaleY

public final int getScaleY()
Gets the y axis direction scale value setting.

Returns:
The y axis direction scale value

setScale

public final void setScale(int sx,
                           int sy)
Enters the scale value. This method excludes the following methods: setParallelSize(int, int) setPerspective(int, int, int) setPerspective(int, int, int, int) Only the final setting will be valid.

Parameters:
sx - Scale value for the x axis direction
sy - Scale value for the y axis direction

getParallelWidth

public final int getParallelWidth()
Gets parallel projection surface width settings.

Returns:
Parallel projection surface width

getParallelHeight

public final int getParallelHeight()
Gets parallel projection surface height settings.

Returns:
Parallel projection surface height

setParallelSize

public final void setParallelSize(int w,
                                  int h)
Enters the parallel projection surface width and height. This method excludes the following methods: setScale(int, int) setPerspective(int, int, int) setPerspective(int, int, int, int) Only the final setting will be valid.

Parameters:
w - Parallel projection surface width
h - Parallel projection surface height
Throws:
java.lang.IllegalArgumentException - When the argument is a negative number.

getCenterX

public final int getCenterX()
Gets the center position x coordinate setting.

Returns:
Center position x coordinate

getCenterY

public final int getCenterY()
Gets the center position y coordinate setting.

Returns:
Center position y coordinate

setCenter

public final void setCenter(int cx,
                            int cy)
Sets the center position coordinates.

Parameters:
cx - The center position x coordinate in the rendering range
cy - The center position y coordinate in the rendering range

setPerspective

public final void setPerspective(int zNear,
                                 int zFar,
                                 int angle)
Specifies the angle of view and enters the prespective projection settings. Rendering will occur only for models and primitives that extend from the near-clipped surface to the far-clipped surface. This method excludes the following methods: setScale(int, int) setParallelSize(int, int) setPerspective(int, int, int, int) Only the final setting will be valid.

Parameters:
zNear - Distance from the camera to the near-clipped surface
zFar - Distance from the camera to the far-clipped surface
angle - Angle of view. 360 degrees expressed using 4096. The valid range is an angle that is greater than zero degrees but less than 180 degrees.
Throws:
java.lang.IllegalArgumentException - When the argument is zNear >= zFar. Argument zNear is smaller than 1 or 32767 or greater. Argument zFar is smaller than 2 or 32768 or greater. The argument angle is 0 or smaller or 2048 or greater.

setPerspective

public final void setPerspective(int zNear,
                                 int zFar,
                                 int width,
                                 int height)
Specifies the width and height of the projection surface of the near-clipped surface and enters the perspective projection settings. Rendering will occur only for models and primitives that extend from the near-clipped surface to the far-clipped surface. This method excludes the following methods: setScale(int, int) setParallelSize(int, int) setPerspective(int, int, int) Only the final setting will be valid.

Parameters:
zNear - Distance from the camera to the near-clipped surface
zFar - Distance from the camera to the far-clipped surface
width - Near-clipped projection surface width (viewing position coordinate system multiplied by 4096, 0 or greater?j
height - Near-clipped projection surface height (viewing position coordinate system multiplied by 4096, 0 or greater?j
Throws:
java.lang.IllegalArgumentException - When argument zNear >= zFar. Argument zNear is smaller than 1 or 32767 or greater. Argument zFar is smaller than 2 or 32768 or greater. Either the argument width or height is a negative number.