JClass DesktopViews 6.3.0 API
Documentation

com.klg.jclass.chart3d
Class DrawGrid

java.lang.Object
  |
  +--com.klg.jclass.chart3d.Draw
        |
        +--com.klg.jclass.chart3d.DrawGrid
All Implemented Interfaces:
Serializable
Direct Known Subclasses:
DrawGridJava3d

public class DrawGrid
extends Draw
implements Serializable

The class that controls the drawing for grid data. It also houses the Ray-surface intersection algorithm for grid data.

See Also:
Serialized Form

Field Summary
static double AB_EPSILON
           
protected  com.klg.jclass.chart3d.DrawFacetFactory drawFacetFactory
           
protected  com.klg.jclass.chart3d.GridRegion gridRegion
           
protected  Vector3d N
           
protected  com.klg.jclass.chart3d.ProcessGrid processGrid
           
protected  Vector3d V0
           
protected  Vector3d V0V1
           
protected  Vector3d V0V2
           
protected  Vector3d V1
           
protected  Vector3d V2
           
 
Fields inherited from class com.klg.jclass.chart3d.Draw
dataView, mapping, originPoint
 
Constructor Summary
DrawGrid()
          Basic constructor.
DrawGrid(com.klg.jclass.chart3d.Chart3dDataView dataView)
          Constructor specifying parent data view.
 
Method Summary
protected  double cubeSpace(Matrix4d absolute, com.klg.jclass.chart3d.Chart3dGridData data, int gridIndex, boolean isX)
          Given a grid index, maps its value to absolute (or Cube) space.
protected  void draw(Graphics gc)
          Actually draws the graph based on the grid data.
protected  void draw2dPoints(Graphics gc)
          For 2d grid data and the chart type is scatter, draws the points.
 Point4d findAbsolutePoint(com.klg.jclass.chart3d.Chart3dGridData data, Matrix4d absolute, int x, int y)
          Maps a point to absolute space.
 com.klg.jclass.chart3d.Chart3dGridData getGridData()
          Data must be grid data.
 com.klg.jclass.chart3d.GridRegion getGridRegion()
          Returns the GridRegion object.
 com.klg.jclass.chart3d.ProcessGrid getProcessGrid()
          Returns the ProcessGrid object.
 boolean gridSurfaceIntersect(Point4d rayOrigin, Point4d rayPoint, Point4d result, com.klg.jclass.chart3d.JCData3dGridIndex index)
          Computes whether the ray defined by the given origin and point, intersects the surface defined by the grid data associated with this object.
protected  double lineIntersect2D(Point3d p1, Point3d p2, Point3d q1, Point3d q2)
          Computes the intersection parameter (t) of a ray (p1->p2) and a line segment (q1->q2) in 2D.
protected  boolean rayIntersectTriangle(Point3d rOrigin, Vector3d rDirection, Point4d vertex0, Point4d vertex1, Point4d vertex2, Point3d intersection, com.klg.jclass.chart3d.JCData3dGridIndex index)
          Given a ray via its origin and direction and a triangle with its vertices , computes the intersection point of the ray and the triangle.
protected  boolean rayTestBar(com.klg.jclass.chart3d.Chart3dGridData data, Point3d rOrigin, Vector3d rDirection, int x, int y, Point3d intersection, com.klg.jclass.chart3d.JCData3dGridIndex index)
          Does the ray with given origin and direction intersect the bar at the given grid point?
protected  boolean rayTestFacet(com.klg.jclass.chart3d.Chart3dGridData data, Point3d rOrigin, Vector3d rDirection, int x, int y, Point3d intersection, com.klg.jclass.chart3d.JCData3dGridIndex index)
          Does the ray with given origin and direction intersect the facet at the given grid point?
protected  boolean testFacet(com.klg.jclass.chart3d.Chart3dGridData data, Point3d rOrigin, Vector3d rDirection, int x, int y, Point3d intersection, com.klg.jclass.chart3d.JCData3dGridIndex index)
          Does the ray with given origin and direction intersect the surface, bar, or scatter plot for the given grid data
 
Methods inherited from class com.klg.jclass.chart3d.Draw
getDataView, getMapping, renderDropLine, renderPoint, setMapping
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

AB_EPSILON

public static final double AB_EPSILON
See Also:
Constant Field Values

gridRegion

protected com.klg.jclass.chart3d.GridRegion gridRegion

processGrid

protected com.klg.jclass.chart3d.ProcessGrid processGrid

drawFacetFactory

protected com.klg.jclass.chart3d.DrawFacetFactory drawFacetFactory

N

protected Vector3d N

V0V1

protected Vector3d V0V1

V0V2

protected Vector3d V0V2

V0

protected Vector3d V0

V1

protected Vector3d V1

V2

protected Vector3d V2
Constructor Detail

DrawGrid

public DrawGrid()
Basic constructor.


DrawGrid

public DrawGrid(com.klg.jclass.chart3d.Chart3dDataView dataView)
Constructor specifying parent data view.

Parameters:
dataView -
Method Detail

getGridData

public com.klg.jclass.chart3d.Chart3dGridData getGridData()
Data must be grid data. This is a convenience method to get the data from the Chart3dDataView.


getGridRegion

public com.klg.jclass.chart3d.GridRegion getGridRegion()
Returns the GridRegion object. This object is used to define the nine regions within a grid based on the current eye position


getProcessGrid

public com.klg.jclass.chart3d.ProcessGrid getProcessGrid()
Returns the ProcessGrid object. This object determines the grid traversal order based on the current eye position.


draw

protected void draw(Graphics gc)
Actually draws the graph based on the grid data.

Specified by:
draw in class Draw
Parameters:
gc -

draw2dPoints

protected void draw2dPoints(Graphics gc)
For 2d grid data and the chart type is scatter, draws the points.

Specified by:
draw2dPoints in class Draw
Parameters:
gc -

cubeSpace

protected double cubeSpace(Matrix4d absolute,
                           com.klg.jclass.chart3d.Chart3dGridData data,
                           int gridIndex,
                           boolean isX)
Given a grid index, maps its value to absolute (or Cube) space.

Parameters:
absolute -
data -
gridIndex -
isX -

findAbsolutePoint

public Point4d findAbsolutePoint(com.klg.jclass.chart3d.Chart3dGridData data,
                                 Matrix4d absolute,
                                 int x,
                                 int y)
Maps a point to absolute space.

Parameters:
data -
absolute -
x -
y -

rayIntersectTriangle

protected boolean rayIntersectTriangle(Point3d rOrigin,
                                       Vector3d rDirection,
                                       Point4d vertex0,
                                       Point4d vertex1,
                                       Point4d vertex2,
                                       Point3d intersection,
                                       com.klg.jclass.chart3d.JCData3dGridIndex index)
Given a ray via its origin and direction and a triangle with its vertices , computes the intersection point of the ray and the triangle. This method returns true if there is an intersection and if its closer than any other ray.

Parameters:
rOrigin -
rDirection -
vertex0 -
vertex1 -
vertex2 -
intersection -
index -

rayTestBar

protected boolean rayTestBar(com.klg.jclass.chart3d.Chart3dGridData data,
                             Point3d rOrigin,
                             Vector3d rDirection,
                             int x,
                             int y,
                             Point3d intersection,
                             com.klg.jclass.chart3d.JCData3dGridIndex index)
Does the ray with given origin and direction intersect the bar at the given grid point?

Parameters:
data -
rOrigin -
rDirection -
x -
y -
intersection -
index -

rayTestFacet

protected boolean rayTestFacet(com.klg.jclass.chart3d.Chart3dGridData data,
                               Point3d rOrigin,
                               Vector3d rDirection,
                               int x,
                               int y,
                               Point3d intersection,
                               com.klg.jclass.chart3d.JCData3dGridIndex index)
Does the ray with given origin and direction intersect the facet at the given grid point?

Parameters:
data -
rOrigin -
rDirection -
x -
y -
intersection -
index -

testFacet

protected boolean testFacet(com.klg.jclass.chart3d.Chart3dGridData data,
                            Point3d rOrigin,
                            Vector3d rDirection,
                            int x,
                            int y,
                            Point3d intersection,
                            com.klg.jclass.chart3d.JCData3dGridIndex index)
Does the ray with given origin and direction intersect the surface, bar, or scatter plot for the given grid data

Parameters:
data -
rOrigin -
rDirection -
x -
y -
intersection -
index -

lineIntersect2D

protected double lineIntersect2D(Point3d p1,
                                 Point3d p2,
                                 Point3d q1,
                                 Point3d q2)
Computes the intersection parameter (t) of a ray (p1->p2) and a line segment (q1->q2) in 2D.

Parameters:
p1 -
p2 -
q1 -
q2 -

gridSurfaceIntersect

public boolean gridSurfaceIntersect(Point4d rayOrigin,
                                    Point4d rayPoint,
                                    Point4d result,
                                    com.klg.jclass.chart3d.JCData3dGridIndex index)
Computes whether the ray defined by the given origin and point, intersects the surface defined by the grid data associated with this object.

Parameters:
rayOrigin -
rayPoint -
result -
index -

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