JClass DesktopViews 6.3.0 API
Documentation

com.klg.jclass.chart3d
Class Cube

java.lang.Object
  |
  +--com.klg.jclass.chart3d.Cube
All Implemented Interfaces:
Serializable
Direct Known Subclasses:
CubeJava3d

public class Cube
extends Object
implements Serializable

See Also:
Serialized Form

Field Summary
protected  boolean[] annotateEdge
           
protected  com.klg.jclass.chart3d.JCChart3dArea area
           
protected  Point4d[] cubePoints
           
protected  boolean[] drawEdge
           
protected static int[][] edges
           
static int FACE_BOTTOM
           
static int FACE_FAR
           
static int FACE_LEFT
           
static int FACE_NEAR
           
static int FACE_RIGHT
           
static int FACE_TOP
           
protected static int[][] faces
           
protected  boolean[] faceVisible
           
static int NUM_EDGES
           
static int NUM_FACES
           
static int NUM_POINTS
           
static int NUM_POINTS_IN_FACE
           
protected static int[][] pointEdges
           
protected static double[][] points
           
static int VP_XMASK
           
static int VP_XMAX
           
static int VP_XMIN
           
static int VP_YMASK
           
static int VP_YMAX
           
static int VP_YMIN
           
static int VP_ZMASK
           
static int VP_ZMAX
           
static int VP_ZMIN
           
static int XNEG_YNEG
           
static int XNEG_YPOS
           
static int XNEG_ZNEG
           
static int XNEG_ZPOS
           
static int XPOS_YNEG
           
static int XPOS_YPOS
           
static int XPOS_ZNEG
           
static int XPOS_ZPOS
           
static int YNEG_ZNEG
           
static int YNEG_ZPOS
           
static int YPOS_ZNEG
           
static int YPOS_ZPOS
           
 
Constructor Summary
Cube()
          Null constructor
Cube(com.klg.jclass.chart3d.JCChart3dArea area)
           
 
Method Summary
protected  void calc2DAnnoEdges()
           
protected  void calc3DAnnoEdges()
          This routine determines the edges which will be used for annotations.
protected  void calcCorner(int min_pt, int max_pt)
           
protected  void calcEdge(int vp_code)
          Constructs the id of the leading edge from the vp_code We know that exactly one of the x,y,z groups must be zero in the vp_code for this routine to be called.
protected  void calcFace(int vp_code)
           
protected  boolean edgeInFace(int face, int edge)
           
protected  boolean faceBackfacing(int face)
          Determines if the given face is backfacing or not.
protected  int findViewPosition()
           
 boolean[] getAnnotateEdge()
          Gets the array which determines whether edges are annotated or not.
 com.klg.jclass.chart3d.JCChart3dArea getChart3dArea()
          Gets the parent chart3d area.
protected  Point4d[] getCubePoints()
          Gets the precomputed cube points in projected space.
protected  boolean[] getDrawEdge()
          Gets the array which determines whether edges are drawn or not.
protected  boolean[] getFaceVisible()
          Gets the array which determines whether faces are visible or not.
 void setChart3dArea(com.klg.jclass.chart3d.JCChart3dArea area)
          Sets the parent chart3d area
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

YNEG_ZNEG

public static final int YNEG_ZNEG
See Also:
Constant Field Values

YNEG_ZPOS

public static final int YNEG_ZPOS
See Also:
Constant Field Values

YPOS_ZNEG

public static final int YPOS_ZNEG
See Also:
Constant Field Values

YPOS_ZPOS

public static final int YPOS_ZPOS
See Also:
Constant Field Values

XNEG_ZNEG

public static final int XNEG_ZNEG
See Also:
Constant Field Values

XNEG_ZPOS

public static final int XNEG_ZPOS
See Also:
Constant Field Values

XPOS_ZNEG

public static final int XPOS_ZNEG
See Also:
Constant Field Values

XPOS_ZPOS

public static final int XPOS_ZPOS
See Also:
Constant Field Values

XNEG_YNEG

public static final int XNEG_YNEG
See Also:
Constant Field Values

XNEG_YPOS

public static final int XNEG_YPOS
See Also:
Constant Field Values

XPOS_YNEG

public static final int XPOS_YNEG
See Also:
Constant Field Values

XPOS_YPOS

public static final int XPOS_YPOS
See Also:
Constant Field Values

FACE_LEFT

public static final int FACE_LEFT
See Also:
Constant Field Values

FACE_RIGHT

public static final int FACE_RIGHT
See Also:
Constant Field Values

FACE_BOTTOM

public static final int FACE_BOTTOM
See Also:
Constant Field Values

FACE_TOP

public static final int FACE_TOP
See Also:
Constant Field Values

FACE_FAR

public static final int FACE_FAR
See Also:
Constant Field Values

FACE_NEAR

public static final int FACE_NEAR
See Also:
Constant Field Values

NUM_POINTS

public static final int NUM_POINTS
See Also:
Constant Field Values

NUM_EDGES

public static final int NUM_EDGES
See Also:
Constant Field Values

NUM_FACES

public static final int NUM_FACES
See Also:
Constant Field Values

NUM_POINTS_IN_FACE

public static final int NUM_POINTS_IN_FACE
See Also:
Constant Field Values

VP_XMAX

public static final int VP_XMAX
See Also:
Constant Field Values

VP_XMIN

public static final int VP_XMIN
See Also:
Constant Field Values

VP_YMAX

public static final int VP_YMAX
See Also:
Constant Field Values

VP_YMIN

public static final int VP_YMIN
See Also:
Constant Field Values

VP_ZMAX

public static final int VP_ZMAX
See Also:
Constant Field Values

VP_ZMIN

public static final int VP_ZMIN
See Also:
Constant Field Values

VP_XMASK

public static final int VP_XMASK
See Also:
Constant Field Values

VP_YMASK

public static final int VP_YMASK
See Also:
Constant Field Values

VP_ZMASK

public static final int VP_ZMASK
See Also:
Constant Field Values

points

protected static final double[][] points

faces

protected static final int[][] faces

edges

protected static final int[][] edges

pointEdges

protected static final int[][] pointEdges

faceVisible

protected boolean[] faceVisible

annotateEdge

protected boolean[] annotateEdge

drawEdge

protected boolean[] drawEdge

cubePoints

protected Point4d[] cubePoints

area

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

Cube

public Cube()
Null constructor


Cube

public Cube(com.klg.jclass.chart3d.JCChart3dArea area)
Parameters:
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 -

getCubePoints

protected Point4d[] getCubePoints()
Gets the precomputed cube points in projected space.

Returns:
The cube points in projected space

getFaceVisible

protected boolean[] getFaceVisible()
Gets the array which determines whether faces are visible or not.

Returns:
The face visible array

getAnnotateEdge

public boolean[] getAnnotateEdge()
Gets the array which determines whether edges are annotated or not.

Returns:
The annotate edge array

getDrawEdge

protected boolean[] getDrawEdge()
Gets the array which determines whether edges are drawn or not.

Returns:
The draw edge array

faceBackfacing

protected boolean faceBackfacing(int face)
Determines if the given face is backfacing or not. Projects the points of the face, in clockwise order, onto the screen.

Parameters:
face -

findViewPosition

protected int findViewPosition()

edgeInFace

protected boolean edgeInFace(int face,
                             int edge)
Parameters:
face -
edge -

calcFace

protected void calcFace(int vp_code)
Parameters:
vp_code -

calcEdge

protected void calcEdge(int vp_code)
Constructs the id of the leading edge from the vp_code We know that exactly one of the x,y,z groups must be zero in the vp_code for this routine to be called. The vp_code is organized as: 00 00 01 XMAX (x-pos) 00 00 10 XMIN (x-neg) 00 01 00 YMAX (y-pos) 00 10 00 YMIN (y-neg) 01 00 00 ZMAX (z-pos) 10 00 00 ZMIN (z-neg)

Parameters:
vp_code -

calcCorner

protected void calcCorner(int min_pt,
                          int max_pt)
Parameters:
min_pt -
max_pt -

calc3DAnnoEdges

protected void calc3DAnnoEdges()
This routine determines the edges which will be used for annotations. There are various possible strategies for choosing the annotation edges. The best choice will depend upon the viewing angle, the data, and the viewer's preferences. Only one stategy is implemented here, but more may be added to this routine at a later time. The strategy used is to discard the 3 edges associated with the furthest corner of the viewing cube, and discard the 3 edges touching the nearest corner of the viewing cube. Of the remaining 6 edges, all may be annotated, or the furthest edge from the viewer for each axis may be discarded to leave 3 edges.


calc2DAnnoEdges

protected void calc2DAnnoEdges()

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